NAME

IPC::Manager::Client::LocalMemory - Process-local in-memory message store for testing only

DESCRIPTION

This client is intended for testing only. It stores all state in a process-local Perl hash and does not work across multiple processes. Messages, peer information, and statistics exist only within the memory of the process that created them.

Use this protocol when you need a lightweight client for unit tests that exercise the IPC::Manager::Client interface without touching the filesystem or requiring external IPC resources.

SYNOPSIS

use IPC::Manager::Client::LocalMemory;
use IPC::Manager::Serializer::JSON;

my $route = IPC::Manager::Client::LocalMemory->spawn();
my $con1  = IPC::Manager::Client::LocalMemory->connect('c1', 'IPC::Manager::Serializer::JSON', $route);
my $con2  = IPC::Manager::Client::LocalMemory->connect('c2', 'IPC::Manager::Serializer::JSON', $route);

$con1->send_message(c2 => {hello => 'world'});
my @msgs = $con2->get_messages;

$con1->disconnect;
$con2->disconnect;
IPC::Manager::Client::LocalMemory->unspawn($route);

LIMITATIONS

METHODS

See IPC::Manager::Client for inherited methods.

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/