ActorBase.registerTimer 方法

定义

重载

registerTimer(Function<Object, CompletableFuture<?>> asyncCallback, Object state, Duration dueTime, Duration period)

Registers a Timer for the actor.

registerTimer(Function<Object, CompletableFuture<?>> asyncCallback, String asyncCallbackFunctionName, Object state, Duration dueTime, Duration period)

Registers a Timer for the actor.

registerTimer(Function<Object, CompletableFuture<?>> asyncCallback, Object state, Duration dueTime, Duration period)

Registers a Timer for the actor.

protected ActorTimer registerTimer(Function<Object, CompletableFuture<?>> asyncCallback, Object state, Duration dueTime, Duration period)

参数

asyncCallback
Function<Object, CompletableFuture<?>>

Callback to invoke when timer fires.

state
Object

State to pass into timer callback.

dueTime
Duration

TimeSpan when actor timer is first due.

period
Duration

TimeSpan for subsequent actor timer invocation.

返回

Returns ActorTimer object.

registerTimer(Function<Object, CompletableFuture<?>> asyncCallback, String asyncCallbackFunctionName, Object state, Duration dueTime, Duration period)

Registers a Timer for the actor.

protected ActorTimer registerTimer(Function<Object, CompletableFuture<?>> asyncCallback, String asyncCallbackFunctionName, Object state, Duration dueTime, Duration period)

参数

asyncCallback
Function<Object, CompletableFuture<?>>

Callback to invoke when timer fires.

asyncCallbackFunctionName
String

name of AsyncCallBack function. It can be used in onPreActorMethodAsync(ActorMethodContext actorMethodContext) and onPostActorMethodAsync(ActorMethodContext actorMethodContext) to initiate any user task on pre- and post- calling of this function. The property getMethodName() will give the method name.

state
Object

State to pass into timer callback.

dueTime
Duration

TimeSpan when actor timer is first due.

period
Duration

TimeSpan for subsequent actor timer invocation.

返回

Returns ActorTimer object.

适用于