Package graphql.execution.reactive
Class NonBlockingMutexExecutor
java.lang.Object
graphql.execution.reactive.NonBlockingMutexExecutor
- All Implemented Interfaces:
Executor
Executor that provides mutual exclusion between the operations submitted to it,
without blocking.
If an operation is submitted to this executor while no other operation is
running, it will run immediately.
If an operation is submitted to this executor while another operation is
running, it will be added to a queue of operations to run, and the executor will
return. The thread currently running an operation will end up running the
operation just submitted.
Operations submitted to this executor should run fast, as they can end up running
on other threads and interfere with the operation of other threads.
This executor can also be used to address infinite recursion problems, as
operations submitted recursively will run sequentially.
Inspired by Public Domain CC0 code at h
https://github.com/jroper/reactive-streams-servlet/tree/master/reactive-streams-servlet/src/main/java/org/reactivestreams/servlet
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
private void
reportFailure
(Thread runner, Throwable thrown) private void
run
(NonBlockingMutexExecutor.RunNode current) private void