GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  DEVEL::EVENTS::HANDLER::LOG::MEMORY (3)

.ds Aq ’

NAME

Devel::Events::Handler::Log::Memory - An optional base role for event generators.

CONTENTS

SYNOPSIS



        use Devel::Events::Handler::Log::Memory;

        my $log = Devel::Events::Handler::Log::Memory->new();

        Some::Geneator->new( handler => $log );



DESCRIPTION

This convenience role provides a basic send_event method, useful for implementing generators.

ATTRIBUTES

events The list of events.

Auto derefs.

matcher The Devel::Events::Match instance used for event matching.

METHODS

clear Remove all events from the log.

Provided by MooseX::AttributeHelpers.

first $cond
first %args Return the first event that matches a certain condition.

Delegates to Devel::Events::Match.

grep $cond
grep %args Return the list of events that match a certain condition.

Delegates to Devel::Events::Match.

limit from => $cond, to => $cond, %args Return events between two events. If if from or to is omitted then it returns all the events up to or from the other filter.

Delegates to Devel::Events::Match.

chunk $marker
chunk %args Cuts the event log into chunks. When $marker matches a new chunk is opened.

Delegates to Devel::Events::Match.

new_event @event Log the event to the events list by calling add_event.
add_event \@event Provided by MooseX::AttributeHelpers.
replay $handler Replay all the events in the log to $handler.

Useful if $handler does heavy analysis that you want to delay.

There isn’t much to it:



        $handler->new_event(@$_) for $self->events;



So obviously you can replay subsets of events manually.

CAVEATS

If any references are present in the event data then they will be preserved till the log is clear. This may cause leaks.

To overcome this problem use Devel::Events::Filter::Stringify. It will not allow overloading unless asked to, so it’s safe to use without side effects.

TODO

Add an option to always hash all the event data for convenience.

Make grep and limit into exportable functions, too.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 DEVEL::EVENTS::HANDLER::LOG::MEMORY (3) 2009-01-10

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.