NAME

IPC::Manager::Client::MessageFiles - Use files on disk as a message store.

DESCRIPTION

The message store is a directory. Each client has a subdirectory. Each message is a file added to the client subdirectories.

SYNOPSIS

use IPC::Manager qw/ipcm_spawn ipcm_connect/;

my $spawn = ipcm_spawn(protocol => 'MessageFiles');

my $con1 = $spawn->connect('con1');
my $con2 = ipcm_connect(con2, $spawn->info);

$con1->send_message(con1 => {'hello' => 'con2'});

my @messages = $con2->get_messages;

METHODS

See IPC::Manager::Client and IPC::Manager::Base::FS for inherited methods.

$inotify = $con->inotify

Returns the Linux::Inotify2 instance watching the client's message directory for newly created message files. Created on first call. Dies unless Linux::Inotify2 is available.

$arrayref_or_undef = $con->message_files($ext)

Scans the client's message directory and returns an arrayref of filenames matching .ready (when $ext is 'ready') or .pend (when $ext is 'pend'), or undef if there are none. As a side-effect, updates the internal pend_count and ready_count caches.

$dirhandle = $con->dir_handle

Returns a cached, rewound directory handle for the client's message directory. Opens the directory on first call.

SOURCE

The source code repository for IPC::Manager can be found at https://github.com/exodist/IPC-Manager.

MAINTAINERS

Chad Granum <exodist@cpan.org>

AUTHORS

Chad Granum <exodist@cpan.org>

COPYRIGHT

Copyright Chad Granum <exodist7@gmail.com>.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See https://dev.perl.org/licenses/