Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing active listeners #350

Open
RaedKhalafDAZN opened this issue Dec 14, 2023 · 6 comments
Open

Accessing active listeners #350

RaedKhalafDAZN opened this issue Dec 14, 2023 · 6 comments
Assignees
Labels
type: question This issue is a question.

Comments

@RaedKhalafDAZN
Copy link

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.

@parfeon
Copy link
Contributor

parfeon commented Dec 14, 2023

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

@parfeon parfeon self-assigned this Dec 14, 2023
@parfeon parfeon added the type: question This issue is a question. label Dec 14, 2023
@RaedKhalafDAZN
Copy link
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.

@parfeon
Copy link
Contributor

parfeon commented Dec 17, 2023

@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.

@RaedKhalafDAZN
Copy link
Author

RaedKhalafDAZN commented Dec 19, 2023

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

@RaedKhalafDAZN
Copy link
Author

@parfeon any updates ?

@parfeon
Copy link
Contributor

parfeon commented Jan 10, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question This issue is a question.
Projects
None yet
Development

No branches or pull requests

2 participants