public interface DamiBus<C,R>
| Modifier and Type | Method and Description |
|---|---|
default R |
call(String topic,
C content)
调用(要求有一个答复)
|
default R |
call(String topic,
C content,
long timeout)
调用(要求有一个答复)
|
R |
call(String topic,
C content,
long timeout,
Supplier<R> fallback)
调用(要求有一个答复)
|
default R |
call(String topic,
C content,
Supplier<R> fallback)
调用(要求有一个答复)
|
default void |
intercept(Interceptor<C,R> interceptor)
拦截
|
void |
intercept(int index,
Interceptor<C,R> interceptor)
拦截
|
void |
listen(String topic,
int index,
TopicListener<Payload<C,R>> listener)
监听
|
default void |
listen(String topic,
TopicListener<Payload<C,R>> listener)
监听
|
TopicRouter<C,R> |
router()
路由器
|
boolean |
send(String topic,
C content)
发送(不需要答复)
|
default R |
sendAndRequest(String topic,
C content)
Deprecated.
1.1.0 (简化模式,更名为 call)
call(String, Object) |
default R |
sendAndRequest(String topic,
C content,
long timeout)
Deprecated.
1.1.0 (简化模式,更名为 call)
call(String, Object, long) |
default R |
sendAndRequest(String topic,
C content,
long timeout,
Supplier<R> fallback)
Deprecated.
1.1.0 (简化模式,更名为 call)
call(String, Object, long, Supplier) |
default R |
sendAndRequest(String topic,
C content,
Supplier<R> fallback)
Deprecated.
1.1.0 (简化模式,更名为 call)
call(String, Object, Supplier) |
boolean |
sendAndSubscribe(String topic,
C content,
Consumer<R> consumer)
Deprecated.
1.1.0 (简化模式,不再支持流调用)
|
void |
unlisten(String topic)
取消监听(主题下的所有监听)
|
void |
unlisten(String topic,
TopicListener<Payload<C,R>> listener)
取消监听
|
void intercept(int index,
Interceptor<C,R> interceptor)
index - 顺序位interceptor - 拦截器default void intercept(Interceptor<C,R> interceptor)
interceptor - 拦截器boolean send(String topic, C content)
topic - 主题content - 内容default R call(String topic, C content)
topic - 主题content - 内容default R call(String topic, C content, long timeout)
topic - 主题content - 内容timeout - 超时(毫秒)default R call(String topic, C content, Supplier<R> fallback)
topic - 主题content - 内容fallback - 应急处理(如果没有返回)R call(String topic, C content, long timeout, Supplier<R> fallback)
topic - 主题content - 内容timeout - 超时(毫秒)fallback - 应急处理(如果没有返回)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 - 监听void unlisten(String topic)
topic - 主题TopicRouter<C,R> router()
@Deprecated default R sendAndRequest(String topic, C content)
call(String, Object)topic - 主题content - 内容@Deprecated default R sendAndRequest(String topic, C content, long timeout)
call(String, Object, long)topic - 主题content - 内容timeout - 超时(毫秒)@Deprecated default R sendAndRequest(String topic, C content, Supplier<R> fallback)
call(String, Object, Supplier)topic - 主题content - 内容fallback - 应急处理(如果没有返回)@Deprecated default R sendAndRequest(String topic, C content, long timeout, Supplier<R> fallback)
call(String, Object, long, Supplier)topic - 主题content - 内容timeout - 超时(毫秒)fallback - 应急处理(如果没有返回)@Deprecated boolean sendAndSubscribe(String topic, C content, Consumer<R> consumer)
topic - 主题content - 内容consumer - 消费者Copyright © 2025. All rights reserved.