Changeset 120dac7 for perl


Ignore:
Timestamp:
Aug 8, 2013, 2:38:50 PM (8 years ago)
Author:
Edward Z. Yang <ezyang@mit.edu>
Branches:
master
Children:
ecd4edf
Parents:
a38becd
git-author:
Jason Gross <jgross@mit.edu> (07/21/11 18:17:41)
git-committer:
Edward Z. Yang <ezyang@mit.edu> (08/08/13 14:38:50)
Message:
Added a hook for wakeup/user input.

I wanted to add a hook that got called on all user-input, but any
non-trivial use of that hook incurred too much overhead (about 7 ms per
paragraph for entry into perl, and another 100 ms or so per paragraph
for execution of the hook; tests run on pasting lorem ipusm, on
linerva).

This hook is called at most once a second (approximately).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perl/lib/BarnOwl/Hooks.pm

    ra38becd r120dac7  
    3535
    3636Called before BarnOwl shutdown
     37
     38=item $wakeup
     39
     40Called, at most once per second, on user input
    3741
    3842=item $receiveMessage
     
    8892
    8993our @EXPORT_OK = qw($startup $shutdown
     94                    $wakeup
    9095                    $receiveMessage $newMessage
    9196                    $mainLoop $getBuddyList
     
    99104our $startup = BarnOwl::Hook->new;
    100105our $shutdown = BarnOwl::Hook->new;
     106our $wakeup = BarnOwl::Hook->new;
    101107our $receiveMessage = BarnOwl::Hook->new;
    102108our $newMessage = BarnOwl::Hook->new;
     
    194200}
    195201
     202sub _wakeup {
     203    $wakeup->run;
     204}
     205
    196206sub _receive_msg {
    197207    my $m = shift;
Note: See TracChangeset for help on using the changeset viewer.