class Events (View source)

Properties

protected resource|null $socket

The cloud socket.

Methods

__construct(string $address)

Create a new instance.

void
emit(array $payload)

Emit an event.

void
emitMany(array $payloads)

Emit many events.

void
write(string $payload)

Write the payload to the socket.

string
format(array $payloads)

Format the payload.

void
ensureConnected()

Ensure the socket is connected.

void
connect()

Connect the socket.

bool
connected()

Determine if the socket is connected.

void
disconnect()

Disconnect the socket.

string
withSocketMetaData(string $message)

Decorate the message with the socket's meta data.

Details

__construct(string $address)

Create a new instance.

Parameters

string $address

void emit(array $payload)

Emit an event.

Parameters

array $payload

Return Value

void

void emitMany(array $payloads)

Emit many events.

Parameters

array $payloads

Return Value

void

protected void write(string $payload)

Write the payload to the socket.

Parameters

string $payload

Return Value

void

protected string format(array $payloads)

Format the payload.

Parameters

array $payloads

Return Value

string

protected void ensureConnected()

Ensure the socket is connected.

Return Value

void

protected void connect()

Connect the socket.

Return Value

void

protected bool connected()

Determine if the socket is connected.

Return Value

bool

protected void disconnect()

Disconnect the socket.

Return Value

void

protected string withSocketMetaData(string $message)

Decorate the message with the socket's meta data.

Parameters

string $message

Return Value

string