view release on metacpan or search on metacpan
lib/POE/Component/Client/SMTP.pm view on Meta::CPAN
=head1 DESCRIPTION
PoCoClient::SMTP allows you to send email messages in an asynchronous manner,
using POE.
Thus your program isn't blocking while busy talking with an (E)SMTP server.
=head1 SYNOPSIS
B<Warning!> The following examples are B<not> complete programs, and
aren't designed to be run as full blown applications. Their purpose is to
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POE/Component/Client/SimpleFTP.pm view on Meta::CPAN
=head2 Internet Relay Chat
You can get live help by using IRC ( Internet Relay Chat ). If you don't know what IRC is,
please read this excellent guide: L<http://en.wikipedia.org/wiki/Internet_Relay_Chat>. Please
be courteous and patient when talking to us, as we might be busy or sleeping! You can join
those networks/channels and get help:
=over 4
=item *
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POE/Component/FunctionBus.pm view on Meta::CPAN
remember that it is rather dependant on code enacting postback type behaviour,
rather than block-and-return.
Not that you could not use block-and-return it would just well, be rather
resource hungry and not very scalable. If you do have a_function() that takes
8 days to run, consider wrapping it in a service that responds that it is busy
or so. That way you can have multiple nodes providing that service.
=head1 SYNOPSIS
Perhaps a little code snippet.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POE/Component/IRC/Plugin/Karma.pm view on Meta::CPAN
=head2 Internet Relay Chat
You can get live help by using IRC ( Internet Relay Chat ). If you don't know what IRC is,
please read this excellent guide: L<http://en.wikipedia.org/wiki/Internet_Relay_Chat>. Please
be courteous and patient when talking to us, as we might be busy or sleeping! You can join
those networks/channels and get help:
=over 4
=item *
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POE/Component/PreforkDispatch.pm view on Meta::CPAN
# Do nothing if queue is empty
return if $#{ $heap->{request_queue} } < 0;
# Find a fork to use
# Check for available, not busy existing forks.
# Choose the fork that's been waiting the longest
my @avail_forks =
sort { $a->{finished_request} <=> $b->{finished_request} }
grep { $_->{status} eq 'idle' }
@{ $heap->{forks} };
lib/POE/Component/PreforkDispatch.pm view on Meta::CPAN
# If no fork found, create a new one if possible. Otherwise, wait.
if (! $use_fork) {
if (int @{ $heap->{forks} } == $heap->{max_forks}) {
# Already forked the max number; have to wait for one to return
$heap->{talkback}("All forks are busy; will wait to handle request after a fork returns") if $heap->{verbose};
return;
}
# Don't forkbomb; delay before spawning another fork
if ($heap->{last_fork_created} && time - $heap->{last_fork_created} < 5) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POE/Component/SNMP/Dispatcher.pm view on Meta::CPAN
my $pdu = $pdu_args[0];
my $fileno = $pdu->transport->fileno;
# enqueue or execute
if ($this->_current_pdu($fileno)) {
# this socket is busy. enqueue.
$this->_enqueue_pending_pdu($fileno => \@pdu_args);
DEBUG_INFO('queued request for [%d] %d requests pending',
$fileno, $this->_pending_pdu_count($fileno));
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POE/Component/SSLify.pm view on Meta::CPAN
=head2 Internet Relay Chat
You can get live help by using IRC ( Internet Relay Chat ). If you don't know what IRC is,
please read this excellent guide: L<http://en.wikipedia.org/wiki/Internet_Relay_Chat>. Please
be courteous and patient when talking to us, as we might be busy or sleeping! You can join
those networks/channels and get help:
=over 4
=item *
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POE/Component/Server/JSONUnix.pm view on Meta::CPAN
croak "'commands' must be a hash reference"
unless ref $cmds eq 'HASH';
$self->register(%$cmds);
}
# Fail fast and synchronously on a busy or unusable socket path, so the
# caller of spawn() gets the error rather than a dead session later.
$self->_prepare_socket_path;
POE::Session->create(
object_states => [
view all matches for this distribution
view release on metacpan or search on metacpan
PreforkTCP.pm view on Meta::CPAN
$kernel->yield('kill', $pid );
next;
# kill the server which exit gracefully.
# if the heartbeat cycle is too long and
# system is too busy, if the system will
# spawn some other process which pid is it?
# maybe , maybe few, but not none.
}
$kernel->yield('term', $pid )
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POE/Component/SimpleDBI.pm view on Meta::CPAN
=head2 Internet Relay Chat
You can get live help by using IRC ( Internet Relay Chat ). If you don't know what IRC is,
please read this excellent guide: L<http://en.wikipedia.org/wiki/Internet_Relay_Chat>. Please
be courteous and patient when talking to us, as we might be busy or sleeping! You can join
those networks/channels and get help:
=over 4
=item *
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POE/Component/SmokeBox/Uploads/Rsync.pm view on Meta::CPAN
=head2 Internet Relay Chat
You can get live help by using IRC ( Internet Relay Chat ). If you don't know what IRC is,
please read this excellent guide: L<http://en.wikipedia.org/wiki/Internet_Relay_Chat>. Please
be courteous and patient when talking to us, as we might be busy or sleeping! You can join
those networks/channels and get help:
=over 4
=item *
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POE/Component/SpreadClient.pm view on Meta::CPAN
=head2 Internet Relay Chat
You can get live help by using IRC ( Internet Relay Chat ). If you don't know what IRC is,
please read this excellent guide: L<http://en.wikipedia.org/wiki/Internet_Relay_Chat>. Please
be courteous and patient when talking to us, as we might be busy or sleeping! You can join
those networks/channels and get help:
=over 4
=item *
view all matches for this distribution
view release on metacpan or search on metacpan
=pod
=head2 play_tone => $type
Plays a tone. $type can be busy, dialx, dial, or ringback.
A warning is produced if you supply an invalid tone.
=cut
sub play_tone {
my ($kernel, $heap, $type) = @_[KERNEL, HEAP, ARG0];
$type = lc($type);
my $found = 0;
foreach my $t (qw(busy dialx dial ringback)) {
$found = 1 if ($type eq $t);
}
unless ($found) {
warn "play_tone: ctserver does not support tone $type";
return;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POE/Component/YahooMessenger.pm view on Meta::CPAN
my $goes_online = POE::Component::YahooMessenger::Event->new(
'goes_online', 0, {
buddy_id => $event->buddy_id($num),
status_code => $status_code,
status_message => $status_message,
busy_code => $event->busy_code($num),
},
);
$kernel->yield(notify => $goes_online->name, $goes_online);
}
}
lib/POE/Component/YahooMessenger.pm view on Meta::CPAN
my($kernel, $heap, $args) = @_[KERNEL, HEAP, ARG0];
$heap->{sock}->put(
POE::Component::YahooMessenger::Event->new(
'change_status', 0, {
status_code => 99, # XXX custom status
busy_code => $args->{busy} || 0,
status_message => $args->{message},
},
),
);
}
lib/POE/Component/YahooMessenger.pm view on Meta::CPAN
message => "Hello World",
});
# change your status
$kernel->post(ym => change_my_status => {
busy => 0, # 0 = not busy
message => "going for lunch now!",
});
# retrieve your buddies list
$kernel->post(ym => buddies => 'retrieve_buddies');
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POE/Declare/Log/File.pm view on Meta::CPAN
}
sub flush : Event {
if ( defined $_[SELF]->{buffer} ) {
# Almost all the time we should arrive here already
# busy. But if we do arrive IDLE accidentally, set as well.
if ( $_[SELF]->{state} eq 'IDLE' ) {
$_[SELF]->{state} = 'BUSY';
}
# Merge the queued messages ourself to prevent having to use a heavier
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POE/Loop/TkCommon.pm view on Meta::CPAN
my $window = shift;
my $error = shift;
if (Tk::Exists($window)) {
my $grab = $window->grab('current');
$grab->Unbusy if defined $grab;
}
chomp($error);
POE::Kernel::_warn "Tk::Error: $error\n " . join("\n ",@_)."\n";
if ($poe_kernel->_data_ses_count()) {
view all matches for this distribution
view release on metacpan or search on metacpan
examples/tcp-server.perl view on Meta::CPAN
my ($offset, $rest) = (0, $ret);
while ($rest) {
my $wrote = syswrite($arg_handle, $buf, $rest, $offset);
# Nasty busy loop for rapid prototyping.
unless ($wrote) {
next if $! == EAGAIN or $! == EWOULDBLOCK;
warn "write error: $!";
$req_input_watcher = undef;
return;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POE/Wheel/Spawner.pm view on Meta::CPAN
=cut
sub spawn {
my ($self, $pid) = @_;
my $filter = POE::Filter::Reference->new();
my $output = $filter->put([{ busy_worker_pid => $pid }]);
print @$output;
} ## end sub spawn
#=head2 _handle_start
lib/POE/Wheel/Spawner.pm view on Meta::CPAN
$kernel->sig_child($w->PID, "_sig_child");
} ## end sub _handle_start
#=head2 _handle_sig_child
#
#Clear heap. Trigger '_next' if !stop_if_done and currently no child is busy
#
#=cut
sub _handle_sig_child {
my ($self, $kernel, $heap, $pid, $exit_val)
lib/POE/Wheel/Spawner.pm view on Meta::CPAN
my $child = delete $heap->{worker_by_pid}{$pid};
unless ($child) {
POE::Kernel::_die("no child pid: $pid");
}
delete $heap->{busy_worker_pid}->{$pid};
if ($self->{stop_if_done}) {
($self->{_workers_sig_count} >= $self->{pool_size}) && return;
}
else {
(scalar(keys(%{ $heap->{busy_worker_pid} })))
|| $kernel->yield("_next");
}
} ## end sub _handle_sig_child
#=head2 _handle_done
lib/POE/Wheel/Spawner.pm view on Meta::CPAN
#=head2 _handle_stdout
#
#evaluate from child to stdout printed result.
#
#trigger _next event if child asks - by using busy_worker_pid printed to stdout - for a sibling
#
#=cut
sub _handle_stdout {
my ($self, $kernel, $heap, $result) = @_[OBJECT, KERNEL, HEAP, ARG0];
if (ref($result) eq 'HASH' && $result->{busy_worker_pid}) {
$heap->{busy_worker_pid}->{ $result->{busy_worker_pid} } = 1;
$kernel->yield("_next");
}
} ## end sub _handle_stdout
1; # End of POE::Wheel::Spawner
view all matches for this distribution
view release on metacpan or search on metacpan
runcap/install-sh view on Meta::CPAN
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd "$dst" 2>/dev/null ||
view all matches for this distribution
view release on metacpan or search on metacpan
Contributions via GitHub pull request are welcome.
Bug fixes in the form of pull requests or bug reports with
new (failing) unit tests have the best chance of being addressed
by busy maintainers, and are B<strongly> encouraged.
If you cannot provide a test or fix, or don't have time to do so,
then regular bug reports are still accepted and appreciated via the
GitHub bug tracker.
view all matches for this distribution
view release on metacpan or search on metacpan
PPresenter/Export/Website/HTML.pm view on Meta::CPAN
TEXT
, -bitmap => 'info'
, -buttons => [ 'OK', 'Cancel' ]
)->Show;
$show->busy(1);
my $dir = $export->{-outputDir};
-d $dir || mkdir $dir, 0755
or die "Cannot create directory $dir: $^E.\n";
PPresenter/Export/Website/HTML.pm view on Meta::CPAN
}
);
$export->makeMainPage($show, $export->slide2filename, \@mainlinks );
$show->busy(0);
$parent->Dialog
( -title => 'Ready'
, -text => 'The website is ready.'
, -bitmap => 'info'
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Padre/Plugin/HG.pm view on Meta::CPAN
sub vcs_execute
{
my ($self, $command, $dir) = @_;
print "Command $command\n";
my $busyCursor = Wx::BusyCursor->new();
my $result = capture_merged(sub{chdir($dir);system($command)});
if (!$result){$result = "Action Completed"}
$busyCursor = undef;
return $result;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Padre/Plugin/SVN.pm view on Meta::CPAN
sub svn_blame {
my ($self) = @_;
my $filename = _get_current_filename();
if ($filename) {
my $main = Padre::Current->main;
$self->{_busyCursor} = Wx::BusyCursor->new();
my $file = svn_file($filename);
$file->blame();
#my $blame = join( "\n", @{ $file->stdout } );
my @blame = @{ $file->stdout };
require Padre::Plugin::SVN::Wx::SVNDialog;
my $dialog = Padre::Plugin::SVN::Wx::SVNDialog->new( $main, $filename, \@blame, 'Blame' );
$self->{_busyCursor} = undef;
$dialog->Show(1);
return 1;
}
return;
lib/Padre/Plugin/SVN.pm view on Meta::CPAN
sub svn_log {
my ( $self, $path ) = @_;
my $main = Padre->ide->wx->main;
my $file = svn_file($path);
$self->{_busyCursor} = Wx::BusyCursor->new();
my $out = join( "\n", @{ $file->log() } );
$self->{_busyCursor} = undef;
#$main->message( $out, "$path" );
require Padre::Plugin::SVN::Wx::SVNDialog;
my $log = Padre::Plugin::SVN::Wx::SVNDialog->new( $main, $path, $out, 'Log' );
$log->Show(1);
lib/Padre/Plugin/SVN.pm view on Meta::CPAN
# whoops!! This isn't going to work "Commit message" is always set in the text control.
if ($message && $message ne 'Commit Message') { # "Commit Message" come from SVNDialog
$self->{_busyCursor} = Wx::BusyCursor->new();
my $revNo = $file->commit($message);
$self->{_busyCursor} = undef;
my @commit = @{ $file->stdout };
my @err = @{ $file->stderr };
if (@err) {
$main->error( join( "\n", @err ), Wx::gettext('Error - SVN Commit') );
lib/Padre/Plugin/SVN.pm view on Meta::CPAN
Wx::gettext("Commit warning"),
Wx::wxYES_NO | Wx::wxCENTRE,
$main,
);
if( $ret == Wx::wxYES ) {
$self->{_busyCursor} = Wx::BusyCursor->new();
my $revNo = $file->commit($message);
$self->{_busyCursor} = undef;
my @commit = @{ $file->stdout };
my @err = @{ $file->stderr };
if (@err) {
$main->error( join( "\n", @err ), 'Error - SVN Commit' );
view all matches for this distribution
view release on metacpan or search on metacpan
share/doc/wxwidgets.pod view on Meta::CPAN
=head2 Wx::BusyCursor::new
wxBusyCursor(wxCursor* cursor = wxHOURGLASS_CURSOR)
Constructs a busy cursor object, calling wxBeginBusyCursor.
=head2 Wx::BusyCursor::DESTROY
~wxBusyCursor()
Destroys the busy cursor object, calling wxEndBusyCursor.
=head1 Wx::BusyInfo
=head2 Wx::BusyInfo::new
wxBusyInfo(const wxString& msg, wxWindow* parent = NULL)
Constructs a busy info window as child of parent and displays msg in
it.
NB: If parent is not NULL you must ensure that it is not closed while
the busy info is shown.
=head2 Wx::BusyInfo::DESTROY
~wxBusyInfo()
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Padre/Lock.pm view on Meta::CPAN
# Enable the locks
my $db = 0;
my $aui = 0;
my $config = 0;
my $busy = 0;
my $update = 0;
foreach (@_) {
if ( $_ ne uc $_ ) {
$locker->method_increment($_);
push @$self, 'method_decrement';
lib/Padre/Lock.pm view on Meta::CPAN
} elsif ( $_ eq 'AUI' ) {
$locker->aui_increment unless $aui;
$aui = 1;
} elsif ( $_ eq 'BUSY' ) {
$locker->busy_increment unless $busy;
$busy = 1;
} else {
Carp::croak("Unknown or unsupported special lock '$_'");
}
}
lib/Padre/Lock.pm view on Meta::CPAN
# becomes a problem, move the DB to first so actions appear to be
# slower, but the UI is immediately available once updated.
#
# Because configuration involves a database write, we always do it
# before we release the database lock.
push @$self, 'busy_decrement' if $busy;
push @$self, 'aui_decrement' if $aui;
push @$self, 'update_decrement' if $update;
push @$self, 'db_decrement' if $db;
push @$self, 'config_decrement' if $config;
view all matches for this distribution
view release on metacpan or search on metacpan
t/regression/29157.dd view on Meta::CPAN
'name' => '',
'phone' => '1003',
'device' => 'Treo 680',
'direction' => 'inbound',
'timestamp' => 1188899063,
'text' => 'Jon XXXX ere-Can u mail a link to any old 700mb torrent that i can upload to XXXX?Been too busy!Got 10 hrs!Gimme a call from www.orange.co.uk by 30200814254',
'type' => '0x400C',
'category' => 0,
'id' => 7107091,
'attributes' => {
'Dirty' => 1,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Parallel/DataPipe.pm view on Meta::CPAN
return unless $result;
return wantarray?@$result:$result;
}
sub run_pipes {
my ($prev_busy,$me,@next) = @_;
my $me_busy = $me->load_data || $me->busy_processors;
while ($me_busy) {
$me->receive_and_merge_data;
$me_busy = $me->load_data || $me->busy_processors;
my $next_busy = @next && run_pipes($prev_busy || $me_busy, @next);
$me_busy ||= $next_busy;
# get data from pipe if we have free_processors
return $me_busy if $prev_busy && $me->free_processors;
}
return 0;
}
# input_iterator is either array or subroutine reference which get's data from queue or other way and returns it
lib/Parallel/DataPipe.pm view on Meta::CPAN
sub load_data_processor {
my ($self,$data,$processor) = @_;
$processor->{item_number} = $self->{item_number}++;
die "no support of data processing for undef items!" unless defined($data);
$processor->{busy} = 1;
$self->_put_data($processor->{child_write},$data);
}
sub busy_processors {
my $self = shift;
return grep $_->{busy}, @{$self->{processors}};
}
sub free_processors {
my $self = shift;
return grep !$_->{busy}, @{$self->{processors}};
}
sub receive_and_merge_data {
my $self = shift;
my ($processors,$ready) = @{$self}{qw(processors ready)};
$self->{ready} = $ready = [] unless $ready;
@$ready = IO::Select->new(map $_->{busy} && $_->{parent_read},@$processors)->can_read() unless @$ready;
my $fh = shift(@$ready);
my $processor = first {$_->{parent_read} == $fh} @$processors;
local $_ = $self->_get_data($fh);
$processor->{busy} = undef; # make processor free
$self->output_iterator($_,$processor->{item_number});
}
sub _kill_data_processors {
my ($self) = @_;
lib/Parallel/DataPipe.pm view on Meta::CPAN
5) If it receives result from chidlren it sends processed data to C<data_merge> subroutine,
and starts loop 2) again.
6) loop 2) continues until input data is ended (end of C<input_iterator> array or C<input_iterator> sub returned undef).
7) In the end parent expects processed data from all busy chidlren and puts processed data to C<data_merge>
8) After having all the children sent processed data they are killed and run returns to the caller.
Note:
If C<input_iterator> or <process_data> returns reference, it serialize/deserialize data before/after pipe.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Parallel/Downloader.pm view on Meta::CPAN
Its goal is not to be better, faster, or smaller than anything else. Its goal is
to provide the user with a single function they can call with a bunch of HTTP
requests and which gives them the responses for them with as little fuss as
possible and most importantly, without downloading them in sequence.
It handles the busywork of grouping requests by hosts and limiting the amount of
simultaneous requests per host, separate from capping the amount of overall
connections. This allows the user to maximize their own connection without
abusing remote hosts.
Of course, there are facilities to customize the exact limits employed and to
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Parallel/Fork/BossWorkerAsync.pm view on Meta::CPAN
# all workers idle, and no partial jobs
# result_queue empty
if ($self->{shutting_down} &&
! @{ $self->{job_queue} } &&
! @{ $self->{result_queue} } ) {
my $busy=0;
my $partials = 0;
for my $s (keys(%$workers)) {
if ( ! $workers->{ $s }->{idle}) {
$busy ++;
last;
} elsif (exists($workers->{ $s }->{partial_job})) {
$partials ++;
last;
}
}
if ( ! $busy && ! $partials) {
# Close all workers
for my $s (keys(%$workers)) {
close($workers->{ $s }->{socket});
}
close($self->{app_socket});
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Parallel/ForkManager.pm view on Meta::CPAN
You can define a subroutine which is called when the child process needs to wait
for the startup. If $period is not defined, then one call is done per
child. If $period is defined, then $code is called periodically and the
module waits for $period seconds between the two calls. Note, $period can be
fractional number also. The exact "$period seconds" is not guaranteed,
signals can shorten and the process scheduler can make it longer (on busy
systems).
The $code called in the "start" and the "wait_all_children" method also.
No parameters are passed to the $code on the call.
view all matches for this distribution