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
Single-process only. The backing store is a package-scoped Perl hash. Forked children inherit a copy but do not share it with the parent or siblings. For cross-process IPC use IPC::Manager::Client::MessageFiles, IPC::Manager::Client::AtomicPipe, IPC::Manager::Client::JSONFile, or IPC::Manager::Client::SharedMem.
have_handles_for_selectandhave_handles_for_peer_changeboth return false. There are no file descriptors to poll.
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
AUTHORS
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.