Skip to content

Conversation

Gattag
Copy link

@Gattag Gattag commented Feb 1, 2021

  • Rewrite ContextScheduler to conform to spec
    • Must move to using TaskQueue but that requires work on core
    • Must provide a Context to WorkerExecutor::executeBlocking but requires work on core
  • Fix tests that attempt to validate an incorrect spec
  • Add new tests that validate proper task order on Worker

Fixes #245

@Gattag
Copy link
Author

Gattag commented Feb 2, 2021

So I realized that there is a slight hiccup in the blocking execution when ordered=true, since they are not directly scheduled for execution immediately, a task scheduled on the ContextScheduler might run after a task run with Context::executeBlocking even if the one on the ContextScheduler was scheduled first. This is even worse when dealing with a WorkerExecutor as that gets wrapped with a runOnContext to ensure it is scheduled with the ordering of the context.

Personally I think allowing a ContextWorker to be accessed across multiple contexts adds unnecessary complexity and I'm not sure if it is something that is necessary I'm completely sure that it breaks the Vert.x concurrency model. I'm only assuming the behavior was sort of expected because in the previous implementation of the scheduler, the context was retrieved at the creation of every TimedAction not at the creation of the ContextWorker.

The more I think about this the more I think I've thought and now concluded that TaskQueue support for WorkerExecutor is required and I need to be able to supply a WorkerExecutor a context to use when I schedule instead of it getting the context from the thread

Also, I realized I should have used ((ContextInternal)this.context).setTimer instead of this.context.owner().setTimer. I need to make a handful of changes to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

RxHelper::blockingScheduler should order by Worker instead of by Context
1 participant