1POE::Resource(3)      User Contributed Perl Documentation     POE::Resource(3)
2
3
4

NAME

6       POE::Resource - documentation for POE's internal event watchers/genera‐
7       tors
8

SYNOPSIS

10         Varies.
11

DESCRIPTION

13       POE manages several types of information internally.  Its Resource
14       classes are designed to manage those types of information behind tidy,
15       encapsulated interfaces.  This allows us to test them individually, as
16       well as re-implement them in C without porting POE::Kernel all at once.
17
18       Currently every POE::Resource class is sufficiently different from the
19       rest that there isn't much to document here.  There are however simi‐
20       larities between them that should be noted.
21
22       While it's not currently the case, every resource should have initial‐
23       izer and finalizer functions.
24
25       Initializers act to link resources to POE::Kernel, usually by swapping
26       lexically scoped variable references between Kernel.pm and each
27       resource's source scopes.
28
29       Finalizers clean up any remaining data and also verify that each
30       resource's subsystem was left in a consistent state.
31
32       At some future time, resources will be loaded dynamically and will need
33       to register their initializers and finalizers with POE::Kernel.  Other‐
34       wise POE::Kernel won't know which to call.
35
36       One common theme in resource implementations is that they don't need to
37       perform much error checking, if any.  Resource methods are used inter‐
38       nally by POE::Kernel and/or APIs (programmer interfaces), so it's up to
39       them to ensure that they're used correctly.
40
41       Resource methods follow the naming convention _data_???_activity, where
42       ??? is an abbreviation for the type of resource it belongs to:
43
44         POE::Resource::Events      _data_ev_initialize
45         POE::Resource::FileHandles _data_handle_initialize
46         POE::Resource::Signals     _data_sig_initialize
47
48       Finalizer methods end in "_finalize".
49
50       Finalizers return true if a resource shut down cleanly, or false if
51       there were inconsistencies or leaks during end-of-run checking.  The
52       t/res/*.t tests rely on these return values.
53
54       We may be able to take advantage of this later by skimming POE::Ker‐
55       nel's namespace for initializers and finalizers automatically.
56

SEE ALSO

58       POE::Resource::Aliases, POE::Resource::Events, POE::Resource::Extrefs,
59       POE::Resource::FileHandles, POE::Resource::SIDs, POE::Resource::Ses‐
60       sions, POE::Resource::Signals
61

BUGS

63       This documentation, and resource specification, are incomplete.  We are
64       developing it as a rationale after the fact for practices that have
65       developed over several months.
66

AUTHORS & LICENSING

68       Please see POE for more information about its authors, contributors,
69       and POE's licensing.
70
71
72
73perl v5.8.8                       2006-09-01                  POE::Resource(3)
Impressum