NAME

Xango::Broker::Push - Xango's Push-Crawler

SYNOPSIS

use Xango::Broker::Push;

Xango::Broker::Push->spawn(
  Loop => 1
);

# in some other session...
foreach my $job (@jobs) {
  $kernel->post($broker_session, 'dispatch_job', $job);
}

DESCRIPTION

Xango::Broker::Push implements the push-model crawler for Xango. A separate session must notify the crawler that there are jobs to be fetched.

This is the preferred model if:

(a) Crawling is triggered by an event, not in a periodic manner
(b) You have long intervals between when jobs are available
(c) You have external entities that can work in a separate process to generate
the list of jobs to be processed

PARAMETERS

Loop (boolean)

If true, the broker session will continue even when the dispatch queue is empty. By default the Push crawler stops when the queue is exhausted, but you can set this to true if you know there are more jobs coming later.

When you set this option, use the 'shutdown' state from elsewhere to stop the broker session.

STATES

enqueue_job($job)

Enqueues a job to be processed.

flush_pending

flushes pending jobs, if possible

finalize_job

busy_loop

Dummy state to keep the broker working until shutdown_broker is called

shutdown_broker

SEE ALSO

Xango::Broker::Base Xango::Broker::Pull

AUTHOR

Copyright (c) 2005 Daisuke Maki <dmaki@cpan.org>. All rights reserved. Development funded by Brazil, Ltd. <http://b.razil.jp>