Deprecate MessageProducer send methods - this closes #3004

This commit is contained in:
Julien Viet
2019-06-27 11:50:12 +02:00
parent 2dc5a1cec4
commit 459ac85b50
2 changed files with 7 additions and 3 deletions

View File

@@ -34,7 +34,9 @@ public interface MessageProducer<T> extends WriteStream<T> {
*
* @param message the message to send
* @return reference to this for fluency
* @deprecated instead use {@link #write} with a producer obtained from {@link EventBus#sender}
*/
@Deprecated
MessageProducer<T> send(T message);
/**
@@ -44,7 +46,9 @@ public interface MessageProducer<T> extends WriteStream<T> {
* @param message the message to send
* @param replyHandler reply handler will be called when any reply from the recipient is received, may be {@code null}
* @return reference to this for fluency
* @deprecated instead use {@link EventBus#request(String, Object, Handler)}
*/
@Deprecated
<R> MessageProducer<T> send(T message, Handler<AsyncResult<Message<R>>> replyHandler);
@Override

View File

@@ -83,7 +83,7 @@ public class EventBusFlowControlTest extends VertxTestBase {
private void sendBatch(MessageProducer<String> prod, int batchSize, int numBatches, int batchNumber) {
while (batchNumber < numBatches) {
for (int i = 0; i < batchSize; i++) {
prod.send("message-" + i);
prod.write("message-" + i);
}
if (prod.writeQueueFull()) {
int nextBatch = batchNumber + 1;
@@ -152,7 +152,7 @@ public class EventBusFlowControlTest extends VertxTestBase {
boolean drainHandlerSet = false;
for (int i = 0; i < wqms * 2; i++) {
prod.send("message-" + i);
prod.write("message-" + i);
if (prod.writeQueueFull() && !drainHandlerSet) {
prod.drainHandler(v -> {
fail("Should not be called");
@@ -184,7 +184,7 @@ public class EventBusFlowControlTest extends VertxTestBase {
while (!prod.writeQueueFull()) {
int val = count++;
expected.add(val);
prod.send(val);
prod.write(val);
}
consumer.resume();
assertWaitUntil(() -> !prod.writeQueueFull());