public interface DamiBus<C,R>
| 限定符和类型 | 方法和说明 |
|---|---|
void |
intercept(int index,
Interceptor interceptor)
拦截
|
void |
listen(String topic,
int index,
TopicListener<Payload<C,R>> listener)
监听
|
default void |
listen(String topic,
TopicListener<Payload<C,R>> listener)
监听
|
boolean |
send(String topic,
C content)
发送(不需要答复)
|
boolean |
sendAndCallback(String topic,
C content,
Consumer<R> callback)
发送并等待回调
|
R |
sendAndResponse(String topic,
C content)
发送并等待响应
|
long |
timeout()
获取响应超时(单位:毫秒)
|
void |
unlisten(String topic,
TopicListener<Payload<C,R>> listener)
取消监听
|
long timeout()
void intercept(int index,
Interceptor interceptor)
index - 顺序位interceptor - 拦截器R sendAndResponse(String topic, C content)
topic - 主题content - 内容boolean sendAndCallback(String topic, C content, Consumer<R> callback)
topic - 主题content - 内容callback - 回调函数default void listen(String topic, TopicListener<Payload<C,R>> listener)
topic - 主题listener - 监听void listen(String topic, int index, TopicListener<Payload<C,R>> listener)
topic - 主题index - 顺序位listener - 监听void unlisten(String topic, TopicListener<Payload<C,R>> listener)
topic - 主题listener - 监听Copyright © 2023. All rights reserved.