Send-KrSseBroadcastEvent
SYNOPSIS
Broadcasts an SSE event to all connected SSE broadcast clients.
SYNTAX
__AllParameterSets
Send-KrSseBroadcastEvent [-Event] <string> [-Data] <string> [[-Id] <string>] [[-RetryMs] <int>]
[[-Server] <KestrunHost>] [<CommonParameters>]
ALIASES
This cmdlet has the following aliases, {{Insert list of aliases}}
DESCRIPTION
Sends an SSE event via the server-wide ISseBroadcaster service (configured by Add-KrSseBroadcastMiddleware). This works both inside a route and outside a route (tasks, scripts) by using the server’s service provider.
EXAMPLES
EXAMPLE 1
Send-KrSseBroadcastEvent -Event ‘tick’ -Data ‘{“i”:1}’
EXAMPLE 2
| Get-KrServer | Send-KrSseBroadcastEvent -Event ‘status’ -Data ‘OK’ |
PARAMETERS
-Data
The data payload of the event.
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 1
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Event
The name of the event.
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 0
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Id
Optional: The event ID.
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 2
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-RetryMs
Optional: The retry interval in milliseconds.
Type: System.Int32
DefaultValue: 0
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 3
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Server
The Kestrun server instance. If not specified, the default server is used.
Type: Kestrun.Hosting.KestrunHost
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 4
IsRequired: false
ValueFromPipeline: true
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
Kestrun.Hosting.KestrunHost
{{ Fill in the Description }}
OUTPUTS
NOTES
Requires Add-KrSseBroadcastMiddleware to be configured on the server.
RELATED LINKS
{{ Fill in the related links here }}