GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Jifty::Plugin::PubSub::Subscriptions(3) User Contributed Perl Documentation Jifty::Plugin::PubSub::Subscriptions(3)

Jifty::Plugin::PubSub::Subscriptions - Manage browser event subscriptions

This class is a global cache of the outstanding subscriptions of requests. When a page is rendered, it may choose to add subscriptions via "update_on" or "add":

    # Update the current region on an event
    Jifty->subs->update_on( topic => "some_event" );

or:

    # Send this topic of events to the browser
    Jifty->subs->add( topic => "some_event" );

These subscriptions are not done in the rendering request, but must be stored until the websocket connection occurs later; this class manages that storage.

The storage is currently an in-memory store which does not purge old subscriptions. This means that if a page with subscriptions is requested 1000 times, but the websocket for them is never established, those subscriptions will be stored until the server is restarted. In the future, these subscriptions may be stored on the session, and expired in conjunction.

The only expected interaction with this module is via "update_on" and "add".

Adds a subscription. If only the TOPIC is given, the event will be passed through to the web browser to interpret. Otherwise, the arguments are used similarly to Jifty::Web::Element to determine which region to update, and how.

As "add", but defaults to refreshing the current region.

Returns the assigned CLIENT_ID of the current connection. This is "undef" if the client has not been assigned any subscriptions yet.

Called internally once per request to reset for the next request.

Returns the data structure of subscriptions for the given CLIENT_ID, and removes it such that it is not accessible to future requests.
2013-02-19 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.