Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/revmischa/web-hippie-pubsub
AnyMQ/Web::Hippie pubsub comet server
https://github.com/revmischa/web-hippie-pubsub
Last synced: 3 days ago
JSON representation
AnyMQ/Web::Hippie pubsub comet server
- Host: GitHub
- URL: https://github.com/revmischa/web-hippie-pubsub
- Owner: revmischa
- Created: 2011-10-29T20:19:35.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2012-11-19T22:39:50.000Z (about 12 years ago)
- Last Synced: 2024-10-18T07:53:37.392Z (3 months ago)
- Language: Perl
- Homepage:
- Size: 188 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
Awesome Lists containing this project
README
NAME
Web::Hippie::PubSub - Comet/Long-poll event server using AnyMQSYNOPSIS
use Plack::Builder;
use AnyMQ;
use AnyMQ::ZeroMQ;my $bus = AnyMQ->new_with_traits(
traits => [ 'ZeroMQ' ],
subscribe_address => 'tcp://localhost:4001',
publish_address => 'tcp://localhost:4000',
);# your plack application
my $app = sub { ... }builder {
# mount hippie server on /_hippie/*
mount '/_hippie' => builder {
enable "+Web::Hippie::PubSub",
keep_alive => 30, # send 'ping' event every 30 seconds
bus => $bus;
sub {
my $env = shift;
my $args = $env->{'hippie.args'};
my $handle = $env->{'hippie.handle'};
# Your handler based on PATH_INFO: /init, /error, /message
}
};
mount '/' => my $app;
};ATTRIBUTES
bus AnyMQ bus configured for publish/subscribe eventskeep_alive
Number of seconds between keep-alive events. ZMQ::Server will send a
"ping" event to keep connections alive. Set to zero to disable.DESCRIPTION
This module adds publish/subscribe capabilities to Web::Hippie using
AnyMQ.See eg/event_server.psgi for example usage.
SEE ALSO
Web::Hippie, Web::Hippie::Pipe, AnyMQ, ZeroMQ::PubSubAUTHOR
Mischa SpiegelmockBased on work by:
Chia-liang Kao
Jonathan Rockway
LICENSE
This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.