public final class GrpcMessageEnvironment extends Object implements MessageEnvironment
edu.snu.nemo.runtime.common.messagepackage. For each GrpcMessageEnvironment, there are a single
GrpcMessageClient, which are responsible for responding replies for messages from other clients, and for transferring messages to other servers, respectively. The
GrpcMessageServeris started as soon as the environment is initialized, and registers the unique sender id of the local node to name server, which is used for id-based communication. The
MessageListeners should be setup to correctly handle incoming messages. The
GrpcMessageClients are created whenever there is a request to create a
MessageSender, a component to issue RPC calls to other servers. Like the
GrpcMessageServerregisters its id to the name server, the
GrpcMessageClientuses target receiver id to look up the name server to resolve the ip address of the target server before establishing a connection to the server.
|Modifier and Type||Method and Description|
Asynchronously connect to the node called
Close this message environment.
Set up a
public <T> void setupListener(String listenerId, MessageListener<T> listener)
MessageListenerwith a listener id.
public void removeListener(String listenerId)
MessageListenerbound to a specific listener ID.
public <T> Future<MessageSender<T>> asyncConnect(String receiverId, String listenerId)
receiverIdand return a future of
MessageSenderthat sends messages to the listener with
Copyright © 2018. All rights reserved.