Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Real-Time Messaging: Subscribing Best Practices

    I have channel that I want my clients to subscribe to upon opening the webapp, and I want them to remain subscribed for the duration of using the webapp.

    Where is the best place to put the Messaging.subscribe() call? I currently have it at the end of onModuleLoad(), which is my entry point method. In the future, there may be multiple channels that I want them to subscribe to upon loading the webapp.

    Secondly, I've noticed that upon calling Messaging.subscribe(), the browser tab shows "Connecting..." with the loading icon for a long period of time, upwards of a minute. This doesn't halt any program execution, nor does client still seem to be in the connecting process. The client receives the messages on the channel despite the browser tab still showing "Connecting...". This behavior happens regardless of where in my code I place the Messaging.subscribe() call. Has this behavior been noted before? It's not a functional blocker but it does look weird...

    SmartClient Version: v9.0p_2014-02-13/EVAL Deployment
    Firefox 26
    Last edited by axle123; 18 Mar 2014, 16:13.

    #2
    I found the answer to my first question in this example on the wiki: https://isomorphic.atlassian.net/wik...ssaging+Module

    In this example, the client registers at the end of onModuleLoad() as I was inclined to do myself.

    For my second question, I believe I've found something resembling an answer in the Messaging API for subscribe():
    "Call to subscribe to channel. This will cause a reconnect to the server - for this reason we defer the actuall reconnect to allow for multiple subscribe() calls in sequence."

    Perhaps that is why it still shows "Connecting..."?

    Comment

    Working...
    X