public class Reader extends Object
Constructor and Description |
---|
Reader(com.yahoo.bullet.pubsub.Subscriber subscriber,
com.yahoo.bullet.pubsub.PubSubResponder responder,
int sleepTimeMS)
Create a service with a
Subscriber and a request queue. |
Modifier and Type | Method and Description |
---|---|
void |
close()
Interrupt the reader thread and close the
Subscriber . |
void |
run()
Read responses from the PubSub and update requests.
|
void |
start()
Starts reading from the pubsub.
|
public Reader(com.yahoo.bullet.pubsub.Subscriber subscriber, com.yahoo.bullet.pubsub.PubSubResponder responder, int sleepTimeMS)
Subscriber
and a request queue.subscriber
- The Subscriber to read responses from.responder
- The PubSubResponder
to use to respond.sleepTimeMS
- The duration to sleep for if PubSub receive is empty. Helps prevent busy waiting.Copyright © 2021 Pivotal Software, Inc.. All rights reserved.