public class PublishQueue extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
PublishQueue.WaitingSubscription |
| Constructor and Description |
|---|
PublishQueue() |
| Modifier and Type | Method and Description |
|---|---|
void |
addRequest(ServiceRequest<PublishRequest,PublishResponse> service)
Add a Publish
ServiceRequest to the queue. |
void |
addSubscription(Subscription subscription)
Add a subscription to the wait list.
|
boolean |
isEmpty() |
boolean |
isNotEmpty() |
ServiceRequest<PublishRequest,PublishResponse> |
poll() |
public void addRequest(ServiceRequest<PublishRequest,PublishResponse> service)
ServiceRequest to the queue.
If there are wait-listed Subscriptions this request will be used immediately, otherwise it will be queued for later use by a Subscription whose publish timer has expired and has notifications to send.
service - the Publish ServiceRequest.public void addSubscription(Subscription subscription)
A subscription should be added to the wait list when either:
a) The previous Publish response indicated that there were still more Notifications ready to be transferred and there were no more Publish requests queued to transfer them.
b) The publishing timer of a Subscription expired and there were either Notifications to be sent or a keep-alive Message to be sent.
subscription - the subscription to wait-list.public boolean isEmpty()
public boolean isNotEmpty()
@Nullable public ServiceRequest<PublishRequest,PublishResponse> poll()
Copyright © 2018. All rights reserved.