Package io.meeds.commons.digest.service
Class DigestSender
java.lang.Object
io.meeds.commons.digest.service.DigestSender
One run of the digest sender job: the safety cleanup, then the selection of
the users due now, then one task per due user serving his frequencies one
after the other, on a small worker pool. Each occurrence is one transaction
of
DigestOccurrenceProcessor: whatever fails in it rolls back, claim
included, and the user is served again at the next run.-
Constructor Summary
ConstructorsConstructorDescriptionDigestSender(DigestScheduleStorage scheduleStorage, DigestDueCalculator dueCalculator, DigestOccurrenceProcessor occurrenceProcessor, int threads, int retentionDays) -
Method Summary
Modifier and TypeMethodDescriptionprotected intHow many candidates one query reads; a test lowers itvoidprotected voidrunInContainer(Runnable task) Binds the portal container and a request lifecycle to the current thread, the way the kernel does for a request: the workers run on a bare pool thread that has none.
-
Constructor Details
-
DigestSender
public DigestSender(DigestScheduleStorage scheduleStorage, DigestDueCalculator dueCalculator, DigestOccurrenceProcessor occurrenceProcessor, @Value("${exo.notification.digest.threads:4}") int threads, @Value("${exo.notification.digest.retention.days:8}") int retentionDays)
-
-
Method Details
-
processDueDigests
public void processDueDigests() -
candidateBatchSize
protected int candidateBatchSize()How many candidates one query reads; a test lowers it -
runInContainer
Binds the portal container and a request lifecycle to the current thread, the way the kernel does for a request: the workers run on a bare pool thread that has none. The previous container, if any, is restored.
-