Nexus API Reference

FiberMailbox
in package
implements Mailbox

FinalYes
Tags
psalm-api
template

T of object

implements

Mailbox<T>

Table of Contents

Interfaces

Mailbox

Methods

__construct()  : mixed
close()  : void
Close the mailbox. Subsequent enqueue() calls return EnqueueResult::Dropped without raising. Blocked dequeueBlocking() calls return null once the mailbox drains (closed-and-empty).
count()  : int
dequeue()  : T|null
dequeueBlocking()  : T
enqueue()  : EnqueueResult
getWaiters()  : array<int, Fiber<mixed, mixed>>
isClosed()  : bool
isEmpty()  : bool
isFull()  : bool

Methods

__construct()

public __construct(MailboxConfig $config[, callable(): void|null $onEnqueue = null ]) : mixed
Parameters
$config : MailboxConfig
$onEnqueue : callable(): void|null = null

close()

Close the mailbox. Subsequent enqueue() calls return EnqueueResult::Dropped without raising. Blocked dequeueBlocking() calls return null once the mailbox drains (closed-and-empty).

public close() : void

Idempotent — calling close() on an already-closed mailbox is a no-op.

Required by Plan 5 (graceful shutdown). Without close(), the actor's message loop has no way to wake up cleanly when the system stops.

dequeue()

public dequeue() : T|null
Return values
T|null

getWaiters()

public getWaiters() : array<int, Fiber<mixed, mixed>>
Return values
array<int, Fiber<mixed, mixed>>

        
On this page

Search results