-
-
24 Feb 2022 16:09:21 UTC
- Distribution: Thread-Csp
- Module version: 0.008
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Repository
- Issues
- Testers (128 / 89 / 0)
- Kwalitee
Bus factor: 1- % Coverage
- License: perl_5
- Perl: v5.8.1
- Activity
24 month- Tools
- Download (134.97KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
NAME
Thread::Csp::Channel - Channels for Communicating sequential processes
VERSION
version 0.008
SYNOPSIS
my $c = Thread::Csp::Channel->new; $c->send("value"); my $rec = $c->receive;
DESCRIPTION
This class represents a channel between two or more CSP threads, allowing any cloneable value (unblessed values, channels and potentially others) to be passed around between threads.
METHODS
new()
This creates a new channel.
send($value)
This sends a value over the channel. It will block until another thread is prepared to receive the value.
receive()
This receives a value from the channel. It will block until another thread is prepared to send the value.
receive_ready_fh()
This will return a filehandle that one byte will be written to when a value has been send to the channel.
send_ready_fh()
This will return a filehandle that one byte will be written to when a value is being received.
close()
This will close the queue. Any
receive
will now return undef, and any write is ignored.AUTHOR
Leon Timmermans <leont@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2021 by Leon Timmermans.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Module Install Instructions
To install Thread::Csp, copy and paste the appropriate command in to your terminal.
cpanm Thread::Csp
perl -MCPAN -e shell install Thread::Csp
For more information on module installation, please visit the detailed CPAN module installation guide.