CancelledNotification extends Notification
This notification can be sent by either side to indicate that it is cancelling a previously-issued request.
The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished.
This notification indicates that the result will be unused, so any associated processing SHOULD cease.
A client MUST NOT attempt to cancel its initialize request.
Tags
Table of Contents
Properties
- $reason : string|null
- $requestId : string|int
- $meta : array<string, mixed>|null
Methods
- __construct() : mixed
- fromArray() : self
- getMethod() : string
- jsonSerialize() : NotificationData
- fromParams() : Notification
- getParams() : array<string, mixed>|null
Properties
$reason read-only
public
string|null
$reason
= null
$requestId read-only
public
string|int
$requestId
$meta
protected
array<string, mixed>|null
$meta
= null
Methods
__construct()
public
__construct(string|int $requestId[, string|null $reason = null ]) : mixed
Parameters
- $requestId : string|int
-
The ID of the request that is being cancelled. This MUST correspond to the ID of a request previously issued in the same direction.
- $reason : string|null = null
-
An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
fromArray()
public
static fromArray(NotificationData $data) : self
Parameters
- $data : NotificationData
Return values
selfgetMethod()
public
static getMethod() : string
Return values
stringjsonSerialize()
public
jsonSerialize() : NotificationData
Return values
NotificationDatafromParams()
protected
static fromParams(array<string|int, mixed>|null $params) : Notification
Parameters
- $params : array<string|int, mixed>|null
Return values
NotificationgetParams()
protected
getParams() : array<string, mixed>|null