IClosure
in
Interface IClosure
Represents a closure handler for events.
Table of Contents
Methods
- AsyncInvoke() : Process|null
- Invokes the closure asynchronously.
- Invoke() : bool|null
- Invokes the closure synchronously.
- Serialize() : string
- Serializes the closure.
- Unserialize() : IClosure|null
- Unserializes a serialized closure.
Methods
AsyncInvoke()
Invokes the closure asynchronously.
public
AsyncInvoke(string|Event $event, mixed $args) : Process|null
Parameters
- $event : string|Event
-
The event object or its name.
- $args : mixed
-
Additional arguments to pass to the closure.
Return values
Process|null —A Process object representing the asynchronous execution, or null if async invocation fails.
Invoke()
Invokes the closure synchronously.
public
Invoke(string|Event $event, mixed $args) : bool|null
Parameters
- $event : string|Event
-
The event object or its name.
- $args : mixed
-
Additional arguments to pass to the closure.
Return values
bool|null —True if the closure was successfully invoked, otherwise false. Null if invocation fails.
Serialize()
Serializes the closure.
public
Serialize() : string
Return values
string —The serialized closure.
Unserialize()
Unserializes a serialized closure.
public
static Unserialize(string $serialized) : IClosure|null
Parameters
- $serialized : string
-
The serialized closure.
Return values
IClosure|null —An instance of IClosure, or null if unserialization fails.