class Call (View source)

Class Call

Methods

__construct(Channel $channel, string $method, Timeval $absolute_deadline, null|string $host_override = null)

Constructs a new instance of the Call class.

object
startBatch(array $batch)

Start a batch of RPC actions.

int
setCredentials(CallCredentials $creds_obj)

Set the CallCredentials for this call.

string
getPeer()

Get the endpoint this call/stream is connected to

cancel()

Cancel the call. This will cause the call to end with STATUS_CANCELLED if it has not already ended with another status.

Details

__construct(Channel $channel, string $method, Timeval $absolute_deadline, null|string $host_override = null)

Constructs a new instance of the Call class.

Parameters

Channel $channel

The channel to associate the call with. Must not be closed.

string $method

The method to call

Timeval $absolute_deadline

The deadline for completing the call

null|string $host_override

The host is set by user (optional)

Exceptions

InvalidArgumentException

object startBatch(array $batch)

Start a batch of RPC actions.

Parameters

array $batch

Array of actions to take

Return Value

object

Object with results of all actions

Exceptions

InvalidArgumentException
LogicException

int setCredentials(CallCredentials $creds_obj)

Set the CallCredentials for this call.

Parameters

CallCredentials $creds_obj

The CallCredentials object

Return Value

int

The error code

Exceptions

InvalidArgumentException

string getPeer()

Get the endpoint this call/stream is connected to

Return Value

string

The URI of the endpoint

cancel()

Cancel the call. This will cause the call to end with STATUS_CANCELLED if it has not already ended with another status.