phasync
Subscription / __construct

Method

Subscription::__construct

Subscribe to $topic: Swerve::subscribe is how an application gets one.

Description#

public Subscription::__construct(
    string $topic,
    float $maxLag = 30.0,
    ?float $heartbeat = null
)

Parameters#

$topic string
The topic to receive
$maxLag float = 30.0
Seconds a message may wait before this subscriber reads it
$heartbeat ?float = null
Yield null when no message came for this many seconds