Skip to content

Conversation

@ivankelly
Copy link
Contributor

Actually, decorate the runnables too, but apply the decoration in a
decorator on the thread so that if a runnable/callable is passed to
the thread, the decoration will be applied.

This allows users of OrderedExecutor/Scheduler to use
executor.chooseThread() for CompletableFuture async handlers and still
get things like the MDC context.

Actually, decorate the runnables too, but apply the decoration in a
decorator on the thread so that if a runnable/callable is passed to
the thread, the decoration will be applied.

This allows users of OrderedExecutor/Scheduler to use
executor.chooseThread() for CompletableFuture async handlers and still
get things like the MDC context.
@ivankelly ivankelly self-assigned this Oct 2, 2018
@ivankelly ivankelly requested review from dlg99, merlimat and sijie October 2, 2018 14:21
@ivankelly
Copy link
Contributor Author

This is blocking tests passing in #1646 .

@dlg99
Copy link
Contributor

dlg99 commented Oct 2, 2018

LGTM.
There is one related item to the executor story (not for this PR, of course): for each runnable we create new objects (depending on configuration, timed and/or context preserving runnables). Would be nice to use recycler for them.

@sijie
Copy link
Member

sijie commented Oct 2, 2018

for each runnable we create new objects (depending on configuration, timed and/or context preserving runnables). Would be nice to use recycler for them.

+1 for using recycler to improve them.

@ivankelly
Copy link
Contributor Author

👍 Recycler sounds good. In general, the executor stuff could do with a bit of a refactor. The way OrderedScheduler inherits from OrderedExecutor rather than a common base is strange and means OrderedScheduler needs to do a bunch of janky casts. Once I clear my outstanding patch series I might take a look at it, along with other thread model stuff.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants