Petabridge.Cmd.Common 1.0.0
Middleware for creating, serializing, and parsing Petabridge.Cmd commands and command palettes.
Showing the top 20 packages that depend on Petabridge.Cmd.Common.
Packages | Downloads |
---|---|
Petabridge.Cmd.Cluster
Petabridge.Cmd module for working with Akka.Cluster.
|
32 |
Petabridge.Cmd.Host
Host engine for the Petabridge.Cmd CLI for managing Akka.NET apps and clusters. Used to load available commands into the cluster itself.
|
22 |
Petabridge.Cmd.Cluster
Commandline tools for working with Akka.NET and Akka.Cluster
|
17 |
Petabridge.Cmd.Host
Host engine for the Petabridge.Cmd CLI for managing Akka.NET apps and clusters. Used to load available commands into the cluster itself.
|
15 |
Petabridge.Cmd.Remote
Akka.Remote Petabridge.Cmd palettes for connection and monitoring.
|
10 |
Petabridge.Cmd.Host
Host engine for the Petabridge.Cmd CLI for managing Akka.NET apps and clusters. Used to load available commands into the cluster itself.
|
9 |
Petabridge.Cmd.Remote
Akka.Remote Petabridge.Cmd palettes for connection and monitoring.
|
8 |
Petabridge.Cmd.Host
Host SDK for Petabridge.Cmd command line management tools for Akka.NET.
|
8 |
Petabridge.Cmd.Cluster
Petabridge.Cmd module for working with Akka.Cluster.
|
7 |
Petabridge.Cmd.Host
Host engine for the Petabridge.Cmd CLI for managing Akka.NET apps and clusters. Used to load available commands into the cluster itself.
|
7 |
Petabridge.Cmd.Host
Host engine for the Petabridge.Cmd CLI for managing Akka.NET apps and clusters. Used to load available commands into the cluster itself.
|
6 |
Petabridge.Cmd.Cluster
Petabridge.Cmd module for working with Akka.Cluster.
|
6 |
Petabridge.Cmd.Host
Host engine for the Petabridge.Cmd CLI for managing Akka.NET apps and clusters. Used to load available commands into the cluster itself.
|
5 |
Petabridge.Cmd.Remote
Akka.Remote Petabridge.Cmd palettes for connection and monitoring.
|
5 |
Petabridge.Cmd.Host
Host SDK for Petabridge.Cmd command line management tools for Akka.NET.
|
5 |
Petabridge.Cmd v1.0.0 is a major release of Petabridge.Cmd that doesn't include any breaking changes for older clients.
Programmatic `IPbmClient` Support**
It is now possible to invoke Petabridge.Cmd programmatically, as of Petabridge.Cmd 1.0.0 - and this can be done in one of two ways:
1. In-process, inside the same Akka.NET `ActorSystem` that is running the `PetabridgeCmd` host;
2. Remotely, from an external process that connects to the `PetabridgeCmd` host using the same TCP port used by the `pbm` CLI clients.
We've added [extensive documentation to the Petabridge.Cmd website which documents how to use these new `IPbmClient` implementations](https://cmd.petabridge.com/articles/clients/index.html#ipbmclient-programmatic-client), but we've also included a small example here:
```csharp
// <configureHost>
// create a Petabridge.Cmd host from our ActorSystem
// host is configured to run on port 11555 via HOCON
var pbmHost = PetabridgeCmd.Get(Sys);
// start the host
pbmHost.Start();
// </configureHost>
// <clientActorSystem>
// create client ActorSystem
using ActorSystem clientSystem = ActorSystem.Create("ClientSystem");
// grab copy of the PetabridgeCmdClient extension (Petabridge.Cmd.Common NuGet package)
var clientExt = PetabridgeCmdClient.Get(clientSystem);
// create IpEndPoint or DnsEndPoint for contacting remote host
// either one of these would work
var ip = new IPEndPoint(IPAddress.Loopback, 11555);
var dns = new DnsEndPoint("localhost", 11555);
// start a new IPbmClient attached to one of these EndPoints
// by default this operation will time out in 5 seconds.
// you can extend that by passing in a custom CancellationToken
IPbmClient remoteClient = await clientExt.StartRemoteClient(ip);
// </clientActorSystem>
// <runClient>
// invoke a "log peek" command, just like you would on CLI
CommandSession session = await remoteClient.ExecuteTextCommandAsync("log peek");
// grab a hold of the Akka.Streams materializer from ActorSystem
var materializer = Sys.Materializer();
// pipe the Akka.Streams Source<CommandResponse> to a Sink<CommandResponse>
// in this case, we're just going to send everything to a TestActor.
//
// This Akka.Streams "graph" can be materialized into a Task, which will
// complete once the stream is marked as complete by the Petabridge.Cmd host.
var completionTask = session.Stream.RunForeach(rsp =>
{
TestActor.Tell(rsp);
}, materializer);
// a client can also cancel the stream using the KillSwitch included
// inside the CommandSession object
session.KillSwitch.Shutdown();
// once either of those two events occur, the Task returned earlier
// will be complete
await completionTask;
// and we can validate that the TestActor received at least one CommandResponse
var response = ExpectMsg<CommandResponse>();
// </runClient>
```
Multiple Concurrent Client Sessions**
Another major architectural change we've introduced to Petabridge.Cmd in order to support programmatic clients is the notion of multiple client-facing sessions all originating from the same connection. Petabridge.Cmd now effectively supports command multi-plexing on the server and client side.
In effect, a single `IPbmClient` can now run multiple streaming commands at once - such as `log tail`, `cluster tail`, and `remote tail`, all over the same TCP connection.
This is a minor breaking change to some command palettes - all of the official Petabridge ones will be updated shortly to support this, but user-defined `CommandPalette`s may also need to be updated in order to support this. We will update our "[Creating Custom Commands](https://cmd.petabridge.com/articles/commands/custom-commands.html)" documentation shortly to help developers implement these changes successfully - the changes required are minor.
.NET Standard 2.0
- Akka.Streams (>= 1.4.21)
- Google.Protobuf (>= 3.17.3)
- System.Diagnostics.Contracts (>= 4.3.0)
Version | Downloads | Last updated |
---|---|---|
1.4.3 | 1 | 07/06/2024 |
1.4.2 | 1 | 06/24/2024 |
1.4.1 | 5 | 04/04/2024 |
1.4.0 | 6 | 01/25/2024 |
1.3.3 | 3 | 01/25/2024 |
1.3.2 | 24 | 09/25/2023 |
1.3.1 | 2 | 02/16/2024 |
1.3.0 | 3 | 06/13/2023 |
1.3.0-beta1 | 2 | 08/27/2023 |
1.2.2 | 4 | 02/16/2024 |
1.2.1 | 2 | 02/16/2024 |
1.2.0 | 6 | 06/13/2023 |
1.1.4 | 5 | 01/25/2024 |
1.1.3 | 4 | 06/14/2023 |
1.1.2 | 4 | 06/13/2023 |
1.1.1 | 3 | 06/13/2023 |
1.1.0 | 7 | 07/11/2022 |
1.0.2 | 27 | 03/30/2022 |
1.0.1 | 6 | 06/14/2023 |
1.0.0 | 5 | 06/13/2023 |
0.8.5 | 6 | 04/10/2022 |
0.8.4 | 5 | 06/13/2023 |
0.8.3 | 5 | 06/12/2023 |
0.8.2 | 5 | 06/14/2023 |
0.8.1 | 4 | 06/13/2023 |
0.8.0 | 5 | 06/13/2023 |
0.8.0-rc2 | 5 | 12/08/2023 |
0.8.0-rc1 | 5 | 12/09/2023 |
0.7.1 | 6 | 06/14/2023 |
0.7.0 | 5 | 06/13/2023 |
0.6.3 | 4 | 06/13/2023 |
0.6.2 | 5 | 06/13/2023 |
0.6.1 | 6 | 06/13/2023 |
0.6.0 | 5 | 06/13/2023 |
0.5.0 | 6 | 06/13/2023 |
0.4.1 | 7 | 12/08/2023 |
0.4.0 | 5 | 06/13/2023 |
0.3.3 | 4 | 06/14/2023 |
0.3.2 | 4 | 06/13/2023 |
0.3.1 | 6 | 06/14/2023 |
0.3.0 | 4 | 06/14/2023 |
0.2.2 | 4 | 06/13/2023 |
0.2.1 | 3 | 06/14/2023 |
0.2.0 | 4 | 06/13/2023 |
0.1.2 | 5 | 06/13/2023 |
0.1.1 | 4 | 06/14/2023 |
0.1.0 | 7 | 06/13/2023 |