public class RESTPubSub extends PubSub
PubSub.Context
Modifier and Type | Field and Description |
---|---|
static int |
NO_CONTENT_204 |
static int |
OK_200 |
static String |
UTF_8 |
Constructor and Description |
---|
RESTPubSub(BulletConfig config)
Create a RESTPubSub from a
BulletConfig . |
Modifier and Type | Method and Description |
---|---|
Publisher |
getPublisher()
Get a
Publisher instance wired to write to all allocated partitions in the appropriate queue (See
PubSub.context ). |
List<Publisher> |
getPublishers(int n)
Get a list of n
Publisher instances with the allocated partitions in the appropriate queue
(See PubSub.context ) split as evenly as possible among them. |
Subscriber |
getSubscriber()
Get a
Subscriber instance wired to read from all allocated partitions in the appropriate queue (See
PubSub.context ). |
List<Subscriber> |
getSubscribers(int n)
Get a list of n
Subscriber instances with allocated partitions from the appropriate queue
(See PubSub.context ) split as evenly as possible among them. |
from, getRequiredConfig, switchContext
public static final int OK_200
public static final int NO_CONTENT_204
public static final String UTF_8
public RESTPubSub(BulletConfig config) throws PubSubException
BulletConfig
.config
- The config.PubSubException
- if the context name is not present or cannot be parsed.public Publisher getPublisher()
PubSub
Publisher
instance wired to write to all allocated partitions in the appropriate queue (See
PubSub.context
).getPublisher
in class PubSub
Publisher
wired as required.public List<Publisher> getPublishers(int n)
PubSub
Publisher
instances with the allocated partitions in the appropriate queue
(See PubSub.context
) split as evenly as possible among them.getPublishers
in class PubSub
n
- The number of Publishers requested.List
of n Publishers wired as required.public Subscriber getSubscriber()
PubSub
Subscriber
instance wired to read from all allocated partitions in the appropriate queue (See
PubSub.context
).getSubscriber
in class PubSub
Subscriber
wired as required.public List<Subscriber> getSubscribers(int n)
PubSub
Subscriber
instances with allocated partitions from the appropriate queue
(See PubSub.context
) split as evenly as possible among them.getSubscribers
in class PubSub
n
- The number of Subscribers requested.List
of n Subscribers wired as required.Copyright © 2021. All rights reserved.