public class BaseOutputBatch extends Object implements OutputBatch
This output batch implementation is the API that is exposed to users.
However, internally it wraps other OutputBatch instances
which handle grouping logic for individual output connections.
| Constructor and Description |
|---|
BaseOutputBatch(String id,
org.vertx.java.core.Vertx vertx,
Collection<OutputBatch> connections) |
| Modifier and Type | Method and Description |
|---|---|
OutputBatch |
drainHandler(org.vertx.java.core.Handler<Void> handler)
Sets a drain handler on the output.
|
void |
end()
Ends the batch.
|
<T> void |
end(T args)
Ends the batch.
|
int |
getSendQueueMaxSize()
Returns the send queue max size.
|
OutputBatch |
group(org.vertx.java.core.Handler<OutputGroup> handler)
Creates a uniquely named output group.
|
OutputBatch |
group(String name,
org.vertx.java.core.Handler<OutputGroup> handler)
Creates a named output group.
|
OutputBatch |
group(String name,
Object args,
org.vertx.java.core.Handler<OutputGroup> handler)
Creates a named output group.
|
String |
id()
Returns the unique batch ID.
|
OutputBatch |
send(Boolean message)
Sends a message on the output.
|
OutputBatch |
send(org.vertx.java.core.buffer.Buffer message)
Sends a message on the output.
|
OutputBatch |
send(Byte message)
Sends a message on the output.
|
OutputBatch |
send(byte[] message)
Sends a message on the output.
|
OutputBatch |
send(Character message)
Sends a message on the output.
|
OutputBatch |
send(Double message)
Sends a message on the output.
|
OutputBatch |
send(Float message)
Sends a message on the output.
|
OutputBatch |
send(Integer message)
Sends a message on the output.
|
OutputBatch |
send(org.vertx.java.core.json.JsonArray message)
Sends a message on the output.
|
OutputBatch |
send(org.vertx.java.core.json.JsonObject message)
Sends a message on the output.
|
OutputBatch |
send(Long message)
Sends a message on the output.
|
OutputBatch |
send(Object message)
Sends a message on the output.
|
OutputBatch |
send(Short message)
Sends a message on the output.
|
OutputBatch |
send(String message)
Sends a message on the output.
|
boolean |
sendQueueFull()
Returns a boolean indicating whether the send queue is full.
|
OutputBatch |
setSendQueueMaxSize(int maxSize)
Sets the send queue max size.
|
int |
size()
Returns the current connection send queue size.
|
org.vertx.java.core.Vertx |
vertx()
Returns the output's Vertx instance.
|
public BaseOutputBatch(String id, org.vertx.java.core.Vertx vertx, Collection<OutputBatch> connections)
public String id()
MessageBatchid in interface MessageBatch<OutputBatch>public org.vertx.java.core.Vertx vertx()
Outputvertx in interface Output<OutputBatch>public OutputBatch setSendQueueMaxSize(int maxSize)
OutputsetSendQueueMaxSize in interface Output<OutputBatch>maxSize - The send queue max size.public int getSendQueueMaxSize()
OutputgetSendQueueMaxSize in interface Output<OutputBatch>public int size()
Outputsize in interface Output<OutputBatch>public boolean sendQueueFull()
OutputsendQueueFull in interface Output<OutputBatch>public OutputBatch drainHandler(org.vertx.java.core.Handler<Void> handler)
OutputWhen the output's send queue becomes full, the output will be temporarily paused while its output queue is empty. Once the queue size decreases back to 50% of the maximum queue size the drain handler will be called so that normal operation can resume.
drainHandler in interface Output<OutputBatch>handler - A handler to be called when the stream is prepared to accept
new messages.public OutputBatch group(org.vertx.java.core.Handler<OutputGroup> handler)
OutputGroupSupportMessages sent through groups will always be sent to the same connection(s). Groups can also be nested.
group in interface OutputGroupSupport<OutputBatch>handler - A handler to be called once the group has been setup.public OutputBatch group(String name, org.vertx.java.core.Handler<OutputGroup> handler)
OutputGroupSupportMessages sent through groups will always be sent to the same connection(s). Groups can also be nested.
group in interface OutputGroupSupport<OutputBatch>name - The output group name.handler - A handler to be called once the group has been setup.public OutputBatch group(String name, Object args, org.vertx.java.core.Handler<OutputGroup> handler)
OutputGroupSupportMessages sent through groups will always be sent to the same connection(s). Groups can also be nested.
group in interface OutputGroupSupport<OutputBatch>name - The output group name.args - Arguments to the group's start handler.handler - A handler to be called once the group has been setup.public OutputBatch send(Object message)
Outputsend in interface Output<OutputBatch>message - The message to send.public OutputBatch send(String message)
Outputsend in interface Output<OutputBatch>message - The message to send.public OutputBatch send(Boolean message)
Outputsend in interface Output<OutputBatch>message - The message to send.public OutputBatch send(Character message)
Outputsend in interface Output<OutputBatch>message - The message to send.public OutputBatch send(Short message)
Outputsend in interface Output<OutputBatch>message - The message to send.public OutputBatch send(Integer message)
Outputsend in interface Output<OutputBatch>message - The message to send.public OutputBatch send(Long message)
Outputsend in interface Output<OutputBatch>message - The message to send.public OutputBatch send(Double message)
Outputsend in interface Output<OutputBatch>message - The message to send.public OutputBatch send(Float message)
Outputsend in interface Output<OutputBatch>message - The message to send.public OutputBatch send(org.vertx.java.core.json.JsonObject message)
Outputsend in interface Output<OutputBatch>message - The message to send.public OutputBatch send(org.vertx.java.core.json.JsonArray message)
Outputsend in interface Output<OutputBatch>message - The message to send.public OutputBatch send(Byte message)
Outputsend in interface Output<OutputBatch>message - The message to send.public OutputBatch send(byte[] message)
Outputsend in interface Output<OutputBatch>message - The message to send.public OutputBatch send(org.vertx.java.core.buffer.Buffer message)
Outputsend in interface Output<OutputBatch>message - The message to send.public void end()
OutputBatchend in interface OutputBatchpublic <T> void end(T args)
OutputBatchend in interface OutputBatchargs - Arguments to the batch's end handler.Copyright © 2013-2014. All Rights Reserved.