public static interface EventRouter.RoutingContext extends AutoCloseable
EventRouter.routingEvent() allowing for zero copy encoding of events directly into the
event log buffer. Routing contexts are typically used inside a try-resource block; see EventRouter
documentation for usage example.| Modifier and Type | Method and Description |
|---|---|
void |
abort()
|
MutableDirectBuffer |
buffer()
Returns the buffer to encode the event directly into the event log.
|
default void |
close()
|
int |
index() |
boolean |
isClosed()
Returns true if this routing context has already been closed through either of
route(int),
abort() or close(). |
void |
route(int length)
Completes event encoding and routes the event; the event will be applied to the application context but it
cannot be polled from the event log yet (starting the next event or completion of command will make the event
available for polling).
|
int index()
MutableDirectBuffer buffer()
IllegalStateException - if this routing context has already been closedvoid route(int length)
length - the encoding length for the routed eventIllegalArgumentException - if length is negativeIllegalStateException - if this routing context has already been closedvoid abort()
boolean isClosed()
route(int),
abort() or close().default void close()
abort(); ignored if the routing context is already
closed.close in interface AutoCloseableCopyright © 2020 tools4j.org (Marco Terzer, Anton Anufriev). All Rights Reserved.