Nexus API Reference

TaskContext
in package
implements Cancellable

FinalYes
Tags
psalm-api

Context passed to background tasks spawned via ActorContext::spawnTask().

Provides cooperative cancellation and a channel back to the parent actor.

Table of Contents

Interfaces

Cancellable

Methods

__construct()  : mixed
cancel()  : void
isCancelled()  : bool
log()  : LoggerInterface
tell()  : void
Send a message to the parent actor.

Methods

__construct()

public __construct(ActorRef<string|int, object> $parentRef, LoggerInterface $logger) : mixed
Parameters
$parentRef : ActorRef<string|int, object>
$logger : LoggerInterface

isCancelled()

public isCancelled() : bool
Return values
bool

log()

public log() : LoggerInterface
Return values
LoggerInterface

tell()

Send a message to the parent actor.

public tell(object $message) : void
Parameters
$message : object

        
On this page

Search results