public java.lang.String register()

public java.lang.String register(ExecutionMode mode)

public java.lang.String register(
    ExecutionMode mode, 
    gears.operations.OnRegisteredOperation onRegister, 
    gears.operations.OnUnregisteredOperation onUnregistered)

Registers the pipeline of functions to run when certain events occur. The registered functions will run each time the event occurs.

Execution modes:

NameDescription
ASYNCRuns asynchronously on all of the shards.
ASYNC_LOCALRuns asynchronously but only on the current shard that generated the event.
SYNCRuns synchronously only on the same shard that generated the event.
Note:
If you call register() without specifying an execution mode, it will default to ASYNC.

Parameters

NameTypeDescription
modeExecutionModeThe execution mode to use (ASYNC/ASYNC_LOCAL/SYNC)
onRegisterOnRegisteredOperationRegister callback that will be called on each shard upon register
onUnregisteredOnUnregisteredOperationUnregister callback that will be called on each shard upon unregister

Returns

Returns a registration ID.

Example

GearsBuilder.CreateGearsBuilder(reader).register();