Skip to content

Conversation

geiralund
Copy link
Contributor

resolves #104

@geiralund geiralund requested a review from a team as a code owner July 28, 2020 07:27
Grace(duration = graceDuration)
}

private val job: Job by lazy {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Må ikke denne brukes på en eller annen måte? Vil launch automagisk starte jobber som child av denne? Såvidt jeg skjønner av docsa så må man bruke enten withContext() eller supervisionScope?

Copy link
Contributor

@gtcno gtcno Jul 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Klassen ER en CoroutineScope(linje 30) og CoroutineContext til scopet inneholder jobben(linje 33).

launch er en extension fun på scopet og arver dermed context og job.
The coroutine context is inherited from a CoroutineScope. Additional context elements can be specified with context argument. If the context does not have any dispatcher nor any other ContinuationInterceptor, then Dispatchers.Default is used. The parent job is inherited from a CoroutineScope as well, but it can also be overridden with a corresponding context element

Men ja det går an å gjøre det litt mer implisitt og lesbar.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ja, den er litt krøkkete, kan lage den mer lesbar

…SupervisorJob for å kunne kontrollere når jobben er aktiv/inaktiv uavhengig av "consumer jobben" (launch, linje 45 pt)

resolves #104
@geiralund geiralund force-pushed the bugfix/stop-consumer-on-exception branch from f0910b9 to ff19911 Compare July 31, 2020 05:29
@geiralund geiralund merged commit aeda7a4 into master Jul 31, 2020
@geiralund geiralund deleted the bugfix/stop-consumer-on-exception branch July 31, 2020 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Robustifisere Kafka consumer som markererer inntekt som brukt
3 participants