Interface EventLoopVirtualThreadScheduler
Scheduler for a virtual thread, with metadata. Does not change throughout a virtual thread's
lifetime. This class allows for creating local shared resources, e.g. HTTP connections that
run on the same event loop.
- Since:
- 4.9.0
- Author:
- Jonas Konrad
-
Method Summary
Modifier and TypeMethodDescription@NonNull io.netty.util.AttributeMapGet a sharedAttributeMapfor this scheduler.static @Nullable EventLoopVirtualThreadSchedulercurrent()Get the virtual thread scheduler of the current thread, if available.@NonNull io.netty.util.concurrent.EventExecutorGet the event loop that runs on this scheduler.
-
Method Details
-
attributeMap
@NonNull io.netty.util.AttributeMap attributeMap()Get a sharedAttributeMapfor this scheduler.- Returns:
- The attribute map
-
eventLoop
@NonNull io.netty.util.concurrent.EventExecutor eventLoop()Get the event loop that runs on this scheduler.- Returns:
- The event loop
-
current
Get the virtual thread scheduler of the current thread, if available.- Returns:
- The current scheduler or
null
-