public class NewThreadWorker extends Scheduler.Worker implements Subscription
| Constructor and Description |
|---|
NewThreadWorker(ThreadFactory
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isUnsubscribed()
Indicates whether this
Subscription is currently unsubscribed.
|
Subscription |
schedule(Action0
Schedules an Action for execution.
|
Subscription |
schedule(Action0
Schedules an Action for execution at some point in the future.
|
ScheduledAction |
scheduleActual(Action0
|
void |
unsubscribe()
Stops the receipt of notifications on the
Subscriber that was registered when this Subscription was received.
|
now, schedulePeriodicallypublic NewThreadWorker(ThreadFactorythreadFactory)
public Subscriptionschedule(Action0 action)
Scheduler.Worker
schedule in class
Scheduler.Worker
action - Action to schedule
public Subscriptionschedule(Action0 action, long delayTime, TimeUnit unit)
Scheduler.Worker
Note to implementors: non-positive delayTime should be regarded as undelayed schedule, i.e., as if the Scheduler was called.
schedule in class
Scheduler.Worker
action - the Action to schedule
delayTime - time to wait before executing the action; non-positive values indicate an undelayed schedule
unit - the time unit of
delayTime
public ScheduledActionscheduleActual(Action0 action, long delayTime, TimeUnit unit)
action -
delayTime -
unit -
public void unsubscribe()
Subscription
Subscriber that was registered when this Subscription was received.
This allows unregistering an Subscriber before it has finished receiving all events (i.e. before onCompleted is called).
public boolean isUnsubscribed()
Subscription
Subscription is currently unsubscribed.
isUnsubscribed in interface
Subscription
true if this
Subscription is currently unsubscribed,
false otherwise