Skip to content

Commit

Permalink
Added initializeCohort
Browse files Browse the repository at this point in the history
  • Loading branch information
sksamuel committed Apr 29, 2024
1 parent 2e4fa90 commit 36df7b2
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ import io.vertx.ext.web.Router
import org.slf4j.LoggerFactory
import java.time.ZoneOffset

fun Router.cohort(
configure: CohortConfiguration.() -> Unit = {},
) {
fun initializeCohort(configure: CohortConfiguration.() -> Unit = {}): CohortConfiguration {
return CohortConfiguration().also(configure)
}

fun Router.cohort(cohort: CohortConfiguration) {

val router = this
val logger = LoggerFactory.getLogger(Router::class.java)
val cohort = CohortConfiguration().also(configure)

if (cohort.heapDump) {
router.get("${cohort.endpointPrefix}/heapdump")
Expand Down

0 comments on commit 36df7b2

Please sign in to comment.