public class Client extends Object implements IConnection
Modifier and Type | Method and Description |
---|---|
void |
close()
gracefully close this client.
|
String |
name() |
Iterator<TaskMessage> |
recv(int flags,
int clientId)
receive a batch message iterator (consists taskId and payload)
|
void |
send(int taskId,
byte[] payload)
send a message with taskId and payload
|
void |
send(Iterator<TaskMessage> msgs)
Enqueue task messages to be sent to server
|
public void send(Iterator<TaskMessage> msgs)
send
in interface IConnection
public String name()
public void close()
close
in interface IConnection
public Iterator<TaskMessage> recv(int flags, int clientId)
IConnection
recv
in interface IConnection
flags
- 0: block, 1: non-blockpublic void send(int taskId, byte[] payload)
IConnection
send
in interface IConnection
taskId
- task IDCopyright © 2014 The Apache Software Foundation. All Rights Reserved.