Package com.tick42.glue.desktop.channels
Interface ChannelContext<T>
- Type Parameters:
T- type of the context data
public interface ChannelContext<T>
Channel context.
-
Method Summary
Modifier and Type Method Description CompletionStage<?>changeChannel(String channel)Changes the current channel of this context.Optional<String>channel()The current name of the channel.TgetData()A snapshot of the current channel context data.CompletionStage<?>publish(Map<String,Object> update)Publish update to the channel context data.CompletionStage<AsynchronousCloseable>subscribe(ChannelContextSubscriber<T> subscriber)Subscribes the specifiedsubscriberfor channel context updates.
-
Method Details
-
channel
The current name of the channel.- Returns:
- name of the channel
-
changeChannel
Changes the current channel of this context.- Parameters:
channel- name of the channel, usenullto leave the current channel- Returns:
- stage that is completed when channel is changed, never
null
-
getData
T getData()A snapshot of the current channel context data.- Returns:
- current context data
-
publish
Publish update to the channel context data.- Parameters:
update- data update- Returns:
- stage that is completed when update is published, never
null
-
subscribe
Subscribes the specifiedsubscriberfor channel context updates.- Parameters:
subscriber- subscriber that will receive updates- Returns:
- stage that is completed when subscription is done, never
null
-