public class NewThreadWorker extends Scheduler.Worker implements Subscription
Constructor and Description |
---|
NewThreadWorker(java.util.concurrent.ThreadFactory threadFactory) |
Modifier and Type | Method and Description |
---|---|
boolean |
isUnsubscribed()
Indicates whether this
Subscription is currently unsubscribed. |
Subscription |
schedule(Action0 action)
Schedules an Action for execution.
|
Subscription |
schedule(Action0 action,
long delayTime,
java.util.concurrent.TimeUnit unit)
Schedules an Action for execution at some point in the future.
|
ScheduledAction |
scheduleActual(Action0 action,
long delayTime,
java.util.concurrent.TimeUnit unit) |
void |
unsubscribe()
Stops the receipt of notifications on the
Subscriber that was registered when this Subscription
was received. |
now, schedulePeriodically
public NewThreadWorker(java.util.concurrent.ThreadFactory threadFactory)
public Subscription schedule(Action0 action)
Scheduler.Worker
schedule
in class Scheduler.Worker
action
- Action to schedulepublic Subscription schedule(Action0 action, long delayTime, java.util.concurrent.TimeUnit unit)
Scheduler.Worker
Note to implementors: non-positive delayTime
should be regarded as undelayed schedule, i.e.,
as if the Scheduler.Worker.schedule(rx.functions.Action0)
was called.
schedule
in class Scheduler.Worker
action
- the Action to scheduledelayTime
- time to wait before executing the action; non-positive values indicate an undelayed
scheduleunit
- the time unit of delayTime
public ScheduledAction scheduleActual(Action0 action, long delayTime, java.util.concurrent.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).
unsubscribe
in interface Subscription
public boolean isUnsubscribed()
Subscription
Subscription
is currently unsubscribed.isUnsubscribed
in interface Subscription
true
if this Subscription
is currently unsubscribed, false
otherwise