public class ReturnChannelMap extends ServerSideFeature
Return channels are only tracked on the server. The client doesn't need to know which channels are registered - it only passes the channel id back to the server. The server checks that the received channel id is (still) valid and logs a warning if it isn't.
For internal use only. May be renamed or removed in a future release.
| Constructor and Description |
|---|
ReturnChannelMap(StateNode node)
Creates a new return channel map for the given state node.
|
| Modifier and Type | Method and Description |
|---|---|
ReturnChannelRegistration |
get(int channelId)
Gets the return channel registration registered with the provided id, or
null if no channel is registered with that id. |
ReturnChannelRegistration |
registerChannel(SerializableBiConsumer<elemental.json.JsonArray,ReturnChannelRegistration> handler)
Registers a new channel based on a callback that receives the provided
arguments and the channel registration when a message is passed to the
channel.
|
ReturnChannelRegistration |
registerChannel(SerializableConsumer<elemental.json.JsonArray> handler)
Registers a new channel based on a callback that receives the provided
arguments when a message is passed to the channel.
|
collectChanges, forEachChild, generateChangesFromEmptyallowsChanges, attachPotentialChild, detatchPotentialChild, getNode, onAttach, onDetachpublic ReturnChannelMap(StateNode node)
node - the owning state node, not nullpublic ReturnChannelRegistration registerChannel(SerializableConsumer<elemental.json.JsonArray> handler)
The returned registration can be passed to the client as a parameter to
various executeJavaScript methods. The client side
representation of the registration will be a function that will send a
message to the provided handler.
handler - the argument handler, not nullpublic ReturnChannelRegistration registerChannel(SerializableBiConsumer<elemental.json.JsonArray,ReturnChannelRegistration> handler)
The returned registration can be passed to the client as a parameter to
various executeJavaScript methods. The client side
representation of the registration will be a function that will send a
message to the provided handler.
handler - the argument and registration handler, not nullpublic ReturnChannelRegistration get(int channelId)
null if no channel is registered with that id.channelId - the channel id to look fornull if no
registration exists for the given idCopyright © 2025. All rights reserved.