Skip to content

Latest commit

 

History

History
59 lines (40 loc) · 1.07 KB

README.md

File metadata and controls

59 lines (40 loc) · 1.07 KB

test

NAME

Nats - client for NATS

SYNOPSIS

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 }

DESCRIPTION

Nats is client for NATS

AUTHOR

Fernando Corrêa de Oliveira fco@cpan.org

COPYRIGHT AND LICENSE

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.