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

Separated event domains #59

Open
Jajcus opened this issue Jul 7, 2011 · 0 comments
Open

Separated event domains #59

Jajcus opened this issue Jul 7, 2011 · 0 comments

Comments

@Jajcus
Copy link
Owner

Jajcus commented Jul 7, 2011

Currently there is, at most, one event queue per main loop and every event is delivered to every handler waiting for this event class. In case when multiple streams would be handled in the same loop, objects related to one stream would receive events generated by all other streams. The can cope with that by checking event.stream, but this is not quite optimal.

The idea:

  • mark events with a 'domain' they belong to. The 'domain' could be any object, e.g. the Client instance for a client session
  • event handler objects would have a event_domain attribute. If it is not None events belonging to other domains would not be delivered to this object. Instead of event_domain we could also have event_domains list to allow a handler belong to many domains
  • handlers with no domain would receive every event, events with no domain would be delivered to every handler – the same as things work now

The change would cost some performance in 'single domain' applications, but should give significant gain in 'multi domain' environment.

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

No branches or pull requests

1 participant