Skip to content

[📚] Guidance around topic subscription calls #10125

@madushans

Description

@madushans

Hey I've noticed that calls to subscribeToTopic and unsubscribeFromTopic take a long time to complete. (the Futures they return take long). Calls to them when device is disconnected from the network usually never complete and sometimes until device is reconnected.

My questions around this is as below

  1. Is it expected that application code awaits these calls?
  2. If multiple calls are made to these functions, does the library maintain the order they were called?
    • For example, if the application does not await these calls (i.e from a Settings page where the user may click through a lot of options and don't want to wait 45 seconds for each click or if the device is disconnected). In this case is the app expected to wait before the next call?
    • Another example is if the app wants to "reset" the subscriptions with unsubscibing from a list of subs, then subscribing again for a subset. In this case should the app await all calls to unsubscribeFromTopic before calling subscribeToTopic or is the package handle ordering?
  3. If the device is disconnected at the time of these calls and the app is terminated, are the calls made later when the app is initialized next time?

I'm thinking of "resetting" topic subscriptions in a background handler if a notification was received on a topic the app is not expecting. However since the calls take a long time, and background execution time is limited?, not sure if this is viable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomersresolution: invalidThis doesn't seem right and might not belong here.type: documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions