public interface Transport
| Modifier and Type | Method and Description |
|---|---|
io.scalecube.net.Address |
address()
Returns local
Address on which current instance of transport listens for incoming
messages. |
boolean |
isStopped()
Return transport's stopped state.
|
reactor.core.publisher.Flux<Message> |
listen()
Returns stream of received messages.
|
reactor.core.publisher.Mono<Message> |
requestResponse(io.scalecube.net.Address address,
Message request)
Sends message to the given address.
|
reactor.core.publisher.Mono<Void> |
send(io.scalecube.net.Address address,
Message message)
Sends message to the given address.
|
reactor.core.publisher.Mono<Void> |
stop()
Stop transport, disconnect all connections and release all resources which belong to this
transport.
|
io.scalecube.net.Address address()
Address on which current instance of transport listens for incoming
messages.reactor.core.publisher.Mono<Void> stop()
listen() will immediately emit onComplete event for all subscribers.boolean isStopped()
reactor.core.publisher.Mono<Void> send(io.scalecube.net.Address address, Message message)
address exists already. Send is an async operation.address - address where message will be sentmessage - message to sendIllegalArgumentException - if message or address is nullreactor.core.publisher.Mono<Message> requestResponse(io.scalecube.net.Address address, Message request)
address exists already. Send is an async operation and expecting a
response by a provided correlationId and sender address of the caller.address - address where message will be sentrequest - to send message must contain correlctionId and sender to handle reply.IllegalArgumentException - if message or address is nullreactor.core.publisher.Flux<Message> listen()
rx.Observer#onNext(Object) will be invoked when some message arrived to current
transport
rx.Observer#onCompleted() will be invoked when there is no possibility that
server will receive new message observable for already closed transport
rx.Observer#onError(Throwable) will not be invoked
Copyright © 2015–2020. All rights reserved.