@Override public void onConsumer(@NotNull WireIn inWire) { if (Jvm.isDebug()) LOG.info("client : bootstrap"); inWire.readDocument(null, d -> { byte remoteIdentifier = d.read(identifierReply).int8(); onConnected(localIdentifier, remoteIdentifier, replication); }); }
@Override public void onConsumer(@NotNull final WireIn inWire) { inWire.readDocument(null, d -> { final StringBuilder eventName = Wires.acquireStringBuilder(); @NotNull final ValueIn valueIn = d.readEventName(eventName); if (PublisherHandler.EventId.onEndOfSubscription.contentEquals(eventName)) { subscriber.onEndOfSubscription(); subscribersToTid.remove(this); hub.unsubscribe(tid()); } else if (CoreFields.reply.contentEquals(eventName)) { @NotNull final Class aClass = rc.elementType(); @Nullable final Object object = (MapEvent.class.isAssignableFrom(aClass) || (TopologicalEvent.class.isAssignableFrom(aClass))) ? valueIn.typedMarshallable() : valueIn.object(rc.elementType()); AbstractRemoteSubscription.this.onEvent(object, subscriber); } }); } });
@Override public void onConsumer(@NotNull final WireIn w) { w.readDocument(null, d -> { final StringBuilder eventname = Wires.acquireStringBuilder(); @NotNull final ValueIn valueIn = d.readEventName(eventname); if (EventId.onEndOfSubscription.contentEquals(eventname)) { subscriber.onEndOfSubscription(); subscribersToTid.remove(this); hub.unsubscribe(tid()); } else if (CoreFields.reply.contentEquals(eventname)) { valueIn.marshallable(m -> { @Nullable final E message = m.read(() -> "message").object(messageClass); RemoteReference.this.onEvent(message, subscriber); }); } }); }
@Override public void onConsumer(@NotNull final WireIn w) { w.readDocument(null, d -> { final StringBuilder eventname = Wires.acquireStringBuilder(); @NotNull final ValueIn valueIn = d.readEventName(eventname); if (onEndOfSubscription.contentEquals(eventname)) { subscriber.onEndOfSubscription(); subscribersToTid.remove(this); hub.unsubscribe(tid()); } else if (CoreFields.reply.contentEquals(eventname)) { valueIn.marshallable(m -> { try { @Nullable final M message = m.read(() -> "message").object(messageClass); RemotePublisher.this.onEvent(message, subscriber); } catch (InvalidSubscriberException e) { throw Jvm.rethrow(e); } }); } }); } });
@Override public void onConsumer(@NotNull final WireIn inWire) { inWire.readDocument(null, d -> { StringBuilder sb = Wires.acquireStringBuilder(); @NotNull ValueIn valueIn = d.readEventName(sb); if (reply.contentEquals(sb)) { valueIn.marshallable(m -> { @Nullable final K topic = m.read(() -> "topic").object(kClass); @Nullable final V message = m.read(() -> "message").object(vClass); RemoteKVSSubscription.this.onEvent(topic, message, subscriber); }); } else if (onEndOfSubscription.contentEquals(sb)) { RemoteKVSSubscription.this.onEndOfSubscription(); hub.unsubscribe(tid()); } }); } });
@Override public void onConsumer(@NotNull final WireIn w) { w.readDocument(null, d -> { final StringBuilder eventname = Wires.acquireStringBuilder(); @NotNull final ValueIn valueIn = d.readEventName(eventname); if (onEndOfSubscription.contentEquals(eventname)) { topicSubscriber.onEndOfSubscription(); hub.unsubscribe(tid()); } else if (CoreFields.reply.contentEquals(eventname)) { valueIn.marshallable(m -> { @Nullable final T topic = m.read(() -> "topic").object(topicClass); @Nullable final M message = m.read(() -> "message").object(messageClass); try { RemoteTopicPublisher.this.onEvent(topic, message, topicSubscriber); } catch (InvalidSubscriberException e) { throw Jvm.rethrow(e); } }); } }); } });
LOG.info("client : onConsumer - publishing updates"); inWire.readDocument(null, d -> {