Skip to content

Unsubscribe from events #109

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions signalrcore/hub/base_hub_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,16 @@ def on(self, event, callback_function: Callable):
"""
self.logger.debug("Handler registered started {0}".format(event))
self.handlers.append((event, callback_function))

def ignore(self, event, callback_function: Callable):
"""Removes a callback from the specified event
Args:
event (string): Event name
callback_function (Function): callback function,
arguments will be binded
"""
self.logger.debug("Handler removed {0}".format(event))
self.handlers.remove((event, callback_function))

def send(self, method, arguments, on_invocation=None, invocation_id=None) -> InvocationResult:
"""Sends a message
Expand Down