Package com.github.ddth.pubsub.impl
Class InmemPubSubHub<ID,DATA>
- java.lang.Object
-
- com.github.ddth.pubsub.impl.AbstractPubSubHub<ID,DATA>
-
- com.github.ddth.pubsub.impl.InmemPubSubHub<ID,DATA>
-
- All Implemented Interfaces:
IPubSubHub<ID,DATA>,AutoCloseable
- Direct Known Subclasses:
UniversalInmemPubSubHub,UniversalInmemPubSubHub
public class InmemPubSubHub<ID,DATA> extends AbstractPubSubHub<ID,DATA>
In-memory implementation ofIPubSubHub.- Since:
- 0.7.0
- Author:
- Thanh Ba Nguyen
-
-
Constructor Summary
Constructors Constructor Description InmemPubSubHub()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()Clean-up method.booleanpublish(String channel, IMessage<ID,DATA> msg)Publish a message to a channel.voidsubscribe(String channel, ISubscriber<ID,DATA> subscriber)Subscribe to a channel for messages.voidunsubscribe(String channel, ISubscriber<ID,DATA> subscriber)Unsubscribe from a channel.-
Methods inherited from class com.github.ddth.pubsub.impl.AbstractPubSubHub
close, createMessage, createMessage, createMessage, deserialize, deserialize, getMessageFactory, getSerDeser, init, serialize, setMessageFactory, setSerDeser
-
-
-
-
Method Detail
-
destroy
public void destroy()
Clean-up method.- Overrides:
destroyin classAbstractPubSubHub<ID,DATA>
-
publish
public boolean publish(String channel, IMessage<ID,DATA> msg)
Publish a message to a channel.- Returns:
-
subscribe
public void subscribe(String channel, ISubscriber<ID,DATA> subscriber)
Subscribe to a channel for messages.
-
unsubscribe
public void unsubscribe(String channel, ISubscriber<ID,DATA> subscriber)
Unsubscribe from a channel.
-
-