Repository navigation
Poll on task availability notices (4.6.0) - #232
Draft
andrejsimic wants to merge 1 commit into
Draft
andrejsimic wants to merge 1 commit into
andrejsimic wants to merge 1 commit into
Conversation
A transport can now announce when tasks of a type may be waiting (ITaskAvailabilityNotifications, in ConductorSharp.Client). UseTaskAvailabilityNotifications(fallbackPollInterval) switches to an execution manager that polls a type when it is announced, keeps polling it until a poll comes back short, and otherwise polls only on the fallback interval. An idle worker sends nothing else. Maestro's NATS transport implements the interface. - The per-task handling both execution managers carried a copy of moved to PolledTaskRunner, which all three use. - The background service treats an OperationCanceledException on stop as a stop. The new manager waits on a semaphore and a channel, which throw that rather than TaskCanceledException.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of CxM-20: workers poll when Maestro announces that tasks are claimable, instead of on a timer. Stacked on #231; the base is
feat/master/maestro-nats.ITaskAvailabilityNotifications(ConductorSharp.Client): implemented by a transport that can announce which task types have work. Maestro's NATS transport does.UseTaskAvailabilityNotifications(fallbackPollInterval): an execution manager that polls a type when it is announced and keeps polling until a poll comes back short. Otherwise it only polls on the fallback interval, so an idle worker sends nothing else. A notice that arrives during a poll keeps the type pending.PolledTaskRunner, which all three use.OperationCanceledExceptionon stop as a stop. The new manager waits on a semaphore and a channel, which throw that rather thanTaskCanceledException.4.6.0: new public API, and
IExecutionManagerBuildergains a member, which breaks any outside implementation of it. Not published; the Maestro draft consumes it as4.6.0-task-notifications.1from a local feed.Tests: 87 pass, 8 new in
NotifiedExecutionManagerTests.Related: codaxy/cx-maestro#192 (Maestro publishes the notifications, and its NATS transport implements the interface).