Class PetabridgeCmd
The petabridge.cmd host. Register CommandPalette instances with this in order to expose new capabilities with petabridge.cmd clients.
Inheritance
Namespace: Petabridge.Cmd.Host
Assembly: cs.temp.dll.dll
Syntax
public sealed class PetabridgeCmd : IExtension
Remarks
Must call the Start() method in order to turn on the host.
Properties
BoundEndpoint
Declaration
public EndPoint BoundEndpoint { get; }
Property Value
Type | Description |
---|---|
EndPoint |
IsBound
When true
, indicates that the inbound listening socket is bound.
Declaration
public bool IsBound { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
You can locate the inbound endpoint via BoundEndpoint
Settings
Declaration
public PetabridgeCmdSettings Settings { get; }
Property Value
Type | Description |
---|---|
PetabridgeCmdSettings |
Sys
Declaration
public ExtendedActorSystem Sys { get; }
Property Value
Type | Description |
---|---|
ExtendedActorSystem |
Methods
Get(ActorSystem)
Retrieves the instance of the PetabridgeCmd
plugin for a given
Declaration
public static PetabridgeCmd Get(ActorSystem sys)
Parameters
Type | Name | Description |
---|---|---|
ActorSystem | sys | The actor system that this petabridge.cmd host will run on. |
Returns
Type | Description |
---|---|
PetabridgeCmd | A singleton instance of the petabridge.cmd host. |
RegisterCommandPalette(CommandPaletteHandler)
Registers a new set of commands defined inside a CommandPalette for execution with the petabridge.cmd host.
Declaration
public bool RegisterCommandPalette(CommandPaletteHandler handler)
Parameters
Type | Name | Description |
---|---|---|
CommandPaletteHandler | handler | The palette handler |
Returns
Type | Description |
---|---|
System.Boolean |
|
Start()
Turns on the petabridge.cmd host. Safe to call multiple times. Will only start the host once.
Declaration
public void Start()
Remarks
No more CommandPalettes can be added once this method is called!
StartLocalClient()
Starts a local
This client can be used over and over again until true
, which happens when
the
Declaration
public Task<IPbmClient> StartLocalClient()
Returns
Type | Description |
---|---|
Task<IPbmClient> | A new in-process |
StartLocalClient(CancellationToken)
Starts a local
This client can be used over and over again until true
, which happens when
the
Declaration
public Task<IPbmClient> StartLocalClient(CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | token | A cancellation token |
Returns
Type | Description |
---|---|
Task<IPbmClient> | A new in-process |