class Idle (View source)

Methods

__construct(Mailbox $mailbox, string $folder, Closure|int $timeout)

Constructor.

__destruct()

Destructor.

void
await(callable $callback)

Await new messages on the connection.

void
listen(callable $callback, CarbonInterface $ttl)

Start listening for new messages using the idle() generator.

folder()

Get the folder to idle.

void
restart()

Issue a done command and restart the idle session.

void
reconnect()

Reconnect the client and restart the idle session.

void
connect()

Connect the client and select the folder to idle.

void
disconnect()

Disconnect the client.

void
done()

End the current IDLE session.

idle(CarbonInterface $ttl)

Begin a new IDLE session as a generator.

CarbonInterface|false
getNextTimeout()

Get the next timeout as a Carbon instance.

Details

__construct(Mailbox $mailbox, string $folder, Closure|int $timeout)

Constructor.

Parameters

Mailbox $mailbox
string $folder
Closure|int $timeout

__destruct()

Destructor.

void await(callable $callback)

Await new messages on the connection.

Parameters

callable $callback

Return Value

void

protected void listen(callable $callback, CarbonInterface $ttl)

Start listening for new messages using the idle() generator.

Parameters

callable $callback
CarbonInterface $ttl

Return Value

void

protected FolderInterface folder()

Get the folder to idle.

Return Value

FolderInterface

protected void restart()

Issue a done command and restart the idle session.

Return Value

void

protected void reconnect()

Reconnect the client and restart the idle session.

Return Value

void

protected void connect()

Connect the client and select the folder to idle.

Return Value

void

protected void disconnect()

Disconnect the client.

Return Value

void

protected void done()

End the current IDLE session.

Return Value

void

protected Generator idle(CarbonInterface $ttl)

Begin a new IDLE session as a generator.

Parameters

CarbonInterface $ttl

Return Value

Generator

protected CarbonInterface|false getNextTimeout()

Get the next timeout as a Carbon instance.

Return Value

CarbonInterface|false