Interface PartitionMessagingService
-
- All Known Implementing Classes:
AtomixPartitionMessagingService
public interface PartitionMessagingServiceAbstracts away messaging to other members of a partition - add operations as needed.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidbroadcast(String subject, ByteBuffer payload)Broadcasts the given payload to all other members of the partition; should log if a member is not subscribed to a given topic, but not fail.voidsubscribe(String subject, Consumer<ByteBuffer> consumer, Executor executor)Subscribes to a given subject - if another member of the partition sends a message on this topic, the consumer will be notified with the given payload.voidunsubscribe(String subject)Unsubcribes from the given subject, such that no messages after this call are handled by any previously registered consumer.
-
-
-
Method Detail
-
subscribe
void subscribe(String subject, Consumer<ByteBuffer> consumer, Executor executor)
Subscribes to a given subject - if another member of the partition sends a message on this topic, the consumer will be notified with the given payload. Each call is considered a new subscription.- Parameters:
subject- the subject to subscribe toconsumer- the consumer which handles the payloadexecutor- the executor on which the consumer is called
-
broadcast
void broadcast(String subject, ByteBuffer payload)
Broadcasts the given payload to all other members of the partition; should log if a member is not subscribed to a given topic, but not fail.- Parameters:
subject- the subject on which to broadcast the payloadpayload- the payload to send
-
unsubscribe
void unsubscribe(String subject)
Unsubcribes from the given subject, such that no messages after this call are handled by any previously registered consumer. If none registered, does nothing.- Parameters:
subject- the subject from which to unsubscribe
-
-