Skip to content

Commit

Permalink
Add tested synopsis examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanstowe committed Sep 14, 2017
1 parent 73008c5 commit 0122014
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
17 changes: 17 additions & 0 deletions examples/reader
@@ -0,0 +1,17 @@
#!/usr/bin/env perl6

use MQ::Posix;

my $queue = MQ::Posix.new(name => 'test-queue', :create, :r );

react {
whenever $queue.Supply -> $buf {
say $buf.decode;
}
whenever signal(SIGINT) {
$queue.close;
$queue.unlink;
done;
}
}

9 changes: 9 additions & 0 deletions examples/writer
@@ -0,0 +1,9 @@
#!/usr/bin/env perl6

use MQ::Posix;

my $queue = MQ::Posix.new(name => 'test-queue', :create, :w );

await $queue.send("some test message", priority => 10);

$queue.close;

0 comments on commit 0122014

Please sign in to comment.