Nats - client for NATS
use Nats;
given Nats.new {
react whenever .start {
whenever .subscribe("bla.ble.bli").supply {
say "Received: { .payload }";
}
}
}
use Nats::Client;
use Nats::Subscriptions;
my $subscriptions = subscriptions {
subscribe -> "bla", $ble, "bli" {
say "ble: $ble";
say "payload: ", message.payload;
message.?reply-json: { :status<ok>, :$ble, :payload(message.payload) };
}
}
my $server = Nats::Client.new: :$subscriptions;
$server.start;
react whenever signal(SIGINT) { $server.stop; exit }
Nats is client for NATS
Fernando Corrêa de Oliveira [email protected]
Copyright 2023 Fernando Corrêa de Oliveira
This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.