ProgressNotification extends Notification
An out-of-band notification used to inform the receiver of a progress update for a long-running request.
Tags
Table of Contents
Properties
- $message : string|null
- $progress : float
- $progressToken : string|int
- $total : float|null
- $meta : array<string, mixed>|null
Methods
- __construct() : mixed
- fromArray() : self
- getMethod() : string
- jsonSerialize() : NotificationData
- fromParams() : Notification
- getParams() : array<string, mixed>|null
Properties
$message read-only
public
string|null
$message
= null
$progress read-only
public
float
$progress
$progressToken read-only
public
string|int
$progressToken
$total read-only
public
float|null
$total
= null
$meta
protected
array<string, mixed>|null
$meta
= null
Methods
__construct()
public
__construct(string|int $progressToken, float $progress[, float|null $total = null ][, string|null $message = null ]) : mixed
Parameters
- $progressToken : string|int
-
the progress token which was given in the initial request, used to associate this notification with the request that is proceeding
- $progress : float
-
The progress thus far. This should increase every time progress is made, even if the total is unknown.
- $total : float|null = null
-
total number of items to process (or total progress required), if known
- $message : string|null = null
-
an optional message describing the current progress
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