public interface PrimarySelector
Modifier and Type | Interface and Description |
---|---|
static class |
PrimarySelector.Factory
Factory for creating primary selectors.
|
Modifier and Type | Method and Description |
---|---|
NodeState |
getState() |
NodeState |
getStateUnsafe() |
Scoped |
onStateChange(java.util.function.Consumer<NodeState> listener)
Registers a listener to be executed whenever the selector's state updates.
|
void |
start(InetSocketAddress localAddress)
Starts the primary selector.
|
void |
stop()
Stops the primary selector.
|
void |
waitForState(NodeState state)
Blocks until the primary selector enters the specified state.
|
void start(InetSocketAddress localAddress)
localAddress
- the address of the local mastervoid stop()
NodeState getState()
NodeState getStateUnsafe()
Scoped onStateChange(java.util.function.Consumer<NodeState> listener)
listener
- the listenervoid waitForState(NodeState state) throws InterruptedException
state
- the state to wait forInterruptedException
Copyright © 2023. All Rights Reserved.