Skip to content

Accessing active listeners #350

Closed
Closed

Description

@RaedKhalafDAZN

Currently, we are using Pubnub.addListener get get access to messages streams,

but, due to multiple channels subscriptions in different parts of the application, we would like to get access to the current active listeners,

and maybe we can add UUID identifiers for each listeners.

Activity

  1. parfeon commented on Dec 14, 2023

    @parfeon
    Contributor

    What do you mean by “access to the current active listeners”? What exactly expected from access to the list of functions?

  2. self-assigned this
    on Dec 14, 2023
  3. RaedKhalafDAZN commented on Dec 16, 2023

    @RaedKhalafDAZN
    Author

    @parfeon I mean, we have in listernes_manager.js all sort of functions to CUD listeners, but we are missing Read of the current listeners.

    in listeners_manager.js

      removeAllListeners() {
        this._listeners = [];
      }
    
      // Added
      getAllListeners() {
        return this._listeners;
      }
    

    In Reactive JS application, we need to react to certain types of events in different parts of the application,
    when we call "AddListener" to pubnub, we need to make sure its not already added before.

    because it will create duplicate messages to the platform.

  4. parfeon commented on Dec 17, 2023

    @parfeon
    Contributor

    @RaedKhalafDAZN thank you for clarification.

    This listener stores listeners created at some point and then re-use them when you want to register?
    If they are the same function objects (during repetitive registration and removal), then from our side we can try to validate whether the listener already added or not.

  5. RaedKhalafDAZN commented on Dec 19, 2023

    @RaedKhalafDAZN
    Author

    Hi @parfeon, that would be great!
    can we have a timeline to do that ?
    I can contribute to support this.

  6. RaedKhalafDAZN commented on Jan 8, 2024

    @RaedKhalafDAZN
    Author

    @parfeon any updates ?

  7. parfeon commented on Jan 10, 2024

    @parfeon
    Contributor

    @RaedKhalafDAZN i apologize for long response. We will make enhancement in upcoming release (end of this week or start of the next)

  8. mohitpubnub commented on Sep 16, 2026

    @mohitpubnub
    Contributor

    The new listener style support might help here.
    Closing this as the the new approach support is released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions