public interface DamiBus<C,R>
| 限定符和类型 | 方法和说明 |
|---|---|
long |
getTimeout()
获取超时
|
void |
intercept(int index,
Interceptor interceptor)
拦截
|
void |
listen(String topic,
int index,
TopicListener<Payload<C,R>> listener)
监听
|
void |
listen(String topic,
TopicListener<Payload<C,R>> listener)
监听
|
void |
requestAndCallback(Payload<C,R> payload,
Consumer<R> callback)
请求并等待回调,自定义载体
|
void |
requestAndCallback(String topic,
C content,
Consumer<R> callback)
请求并等待回调
|
R |
requestAndResponse(Payload<C,R> payload)
请求并等待响应,自定义载体
|
R |
requestAndResponse(String topic,
C content)
请求并等待响应
|
void |
response(Payload<C,R> request,
R content)
响应
|
void |
send(Payload<C,R> payload)
发送(不需要响应),自定义载体
|
void |
send(String topic,
C content)
发送(不需要响应)
|
void |
setTimeout(long timeout)
设置超时
|
void |
unlisten(String topic,
TopicListener<Payload<C,R>> listener)
取消监听
|
long getTimeout()
void setTimeout(long timeout)
timeout - 超时void intercept(int index,
Interceptor interceptor)
index - 顺序位interceptor - 拦截器R requestAndResponse(String topic, C content)
topic - 主题content - 内容void requestAndCallback(String topic, C content, Consumer<R> callback)
topic - 主题content - 内容callback - 回调函数void requestAndCallback(Payload<C,R> payload, Consumer<R> callback)
payload - 发送载体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.