class LazyPromise implements PromiseInterface (View source)

Properties

protected list<callable> $pending

The callbacks to execute after the Guzzle Promise has been built.

protected PromiseInterface $guzzlePromise

The promise built by the creator.

Methods

__construct(Closure $promiseBuilder)

Create a new lazy promise instance.

PromiseInterface
buildPromise()

Build the promise from the promise builder.

PromiseInterface
then(callable|null $onFulfilled = null, callable|null $onRejected = null)

No description

PromiseInterface
otherwise(callable $onRejected)

No description

string
getState()

No description

void
resolve($value)

No description

void
reject($reason)

No description

void
cancel()

No description

wait(bool $unwrap = true)

No description

bool
promiseNeedsBuilt()

Determine if the promise has been created from the promise builder.

Details

__construct(Closure $promiseBuilder)

Create a new lazy promise instance.

Parameters

Closure $promiseBuilder

The callback to build a new PromiseInterface.

PromiseInterface buildPromise()

Build the promise from the promise builder.

Return Value

PromiseInterface

Exceptions

RuntimeException

PromiseInterface then(callable|null $onFulfilled = null, callable|null $onRejected = null)

No description

Parameters

callable|null $onFulfilled
callable|null $onRejected

Return Value

PromiseInterface

PromiseInterface otherwise(callable $onRejected)

No description

Parameters

callable $onRejected

Return Value

PromiseInterface

string getState()

No description

Return Value

string

void resolve($value)

No description

Parameters

$value

Return Value

void

void reject($reason)

No description

Parameters

$reason

Return Value

void

void cancel()

No description

Return Value

void

wait(bool $unwrap = true)

No description

Parameters

bool $unwrap

bool promiseNeedsBuilt()

Determine if the promise has been created from the promise builder.

Return Value

bool

Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.