Mojo::MemoryMap::Writer - Writer
use Mojo::MemoryMap::Writer; my $writer = Mojo::MemoryMap::Writer->new(map => $map); $writer->store({foo => 123}); say $writer->fetch->{foo};
Mojo::MemoryMap::Writer is a scope guard for Mojo::MemoryMap that allows you to write safely to anonymous mapped memory segments.
Mojo::MemoryMap::Writer inherits all methods from Mojo::Base and implements the following new ones.
my $bool = $writer->change(sub {...});
Fetch data, modify it in the closure and store it again right away.
# Remove a value safely $writer->change(sub { delete $_->{foo} });
my $data = $writer->fetch;
Fetch data.
my $writer = Mojo::MemoryMap::Writer->new; my $writer = Mojo::MemoryMap::Writer->new(map => $map); my $writer = Mojo::MemoryMap::Writer->new({map => $map});
Construct a new Mojo::MemoryMap::Writer object.
my $bool = $writer->store({foo => 123});
Store data, replacing all existing data.
Mojolicious::Plugin::Status, Mojolicious::Guides, https://mojolicious.org.
To install Mojolicious::Plugin::Status, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious::Plugin::Status
CPAN shell
perl -MCPAN -e shell install Mojolicious::Plugin::Status
For more information on module installation, please visit the detailed CPAN module installation guide.