public abstract class AbstractActor extends Object
Modifier | Constructor and Description |
---|---|
protected |
AbstractActor(ActorRuntimeContext runtimeContext,
ActorId id)
Instantiates a new Actor.
|
Modifier and Type | Method and Description |
---|---|
protected ActorStateManager |
getActorStateManager()
Returns the state store manager for this Actor.
|
protected ActorId |
getId()
Returns the id of the actor.
|
protected reactor.core.publisher.Mono<Void> |
onActivate()
Callback function invoked after an Actor has been activated.
|
protected reactor.core.publisher.Mono<Void> |
onDeactivate()
Callback function invoked after an Actor has been deactivated.
|
protected reactor.core.publisher.Mono<Void> |
onPostActorMethod(ActorMethodContext actorMethodContext)
Callback function invoked after method is invoked.
|
protected reactor.core.publisher.Mono<Void> |
onPreActorMethod(ActorMethodContext actorMethodContext)
Callback function invoked before method is invoked.
|
protected <T> reactor.core.publisher.Mono<Void> |
registerActorTimer(String timerName,
String callback,
T state,
Duration dueTime,
Duration period)
Registers a Timer for the actor.
|
protected <T> reactor.core.publisher.Mono<Void> |
registerReminder(String reminderName,
T state,
Duration dueTime,
Duration period)
Registers a reminder for this Actor.
|
protected reactor.core.publisher.Mono<Void> |
saveState()
Saves the state of this Actor.
|
protected reactor.core.publisher.Mono<Void> |
unregisterReminder(String reminderName)
Unregisters a Reminder.
|
protected reactor.core.publisher.Mono<Void> |
unregisterTimer(String timerName)
Unregisters an Actor timer.
|
protected AbstractActor(ActorRuntimeContext runtimeContext, ActorId id)
runtimeContext
- Context for the runtime.id
- Actor identifier.protected ActorId getId()
protected ActorStateManager getActorStateManager()
protected <T> reactor.core.publisher.Mono<Void> registerReminder(String reminderName, T state, Duration dueTime, Duration period)
T
- Type of the state object.reminderName
- Name of the reminder.state
- State to be send along with reminder triggers.dueTime
- Due time for the first trigger.period
- Frequency for the triggers.protected <T> reactor.core.publisher.Mono<Void> registerActorTimer(String timerName, String callback, T state, Duration dueTime, Duration period)
T
- Type for the state to be passed in to timer.timerName
- Name of the timer, unique per Actor (auto-generated if null).callback
- Name of the method to be called.state
- State to be passed it to the method when timer triggers.dueTime
- The amount of time to delay before the async callback is first invoked.
Specify negative one (-1) milliseconds to prevent the timer from starting.
Specify zero (0) to start the timer immediately.period
- The time interval between invocations of the async callback.
Specify negative one (-1) milliseconds to disable periodic signaling.protected reactor.core.publisher.Mono<Void> unregisterTimer(String timerName)
timerName
- Name of Timer to be unregistered.protected reactor.core.publisher.Mono<Void> unregisterReminder(String reminderName)
reminderName
- Name of Reminder to be unregistered.protected reactor.core.publisher.Mono<Void> onActivate()
protected reactor.core.publisher.Mono<Void> onDeactivate()
protected reactor.core.publisher.Mono<Void> onPreActorMethod(ActorMethodContext actorMethodContext)
actorMethodContext
- Method context.protected reactor.core.publisher.Mono<Void> onPostActorMethod(ActorMethodContext actorMethodContext)
actorMethodContext
- Method context.protected reactor.core.publisher.Mono<Void> saveState()
Copyright © 2020. All rights reserved.