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

Make @subscribe and @register accept options #336

Closed
deceze opened this issue Feb 12, 2015 · 3 comments
Closed

Make @subscribe and @register accept options #336

deceze opened this issue Feb 12, 2015 · 3 comments

Comments

@deceze
Copy link
Contributor

deceze commented Feb 12, 2015

The @subscribe and @register decorators should accept the same options as the corresponding methods in ApplicationSession, e.g.:

@register('foo', RegisterOptions(details_arg='bar', discloseCaller=True))
def baz(bar):
  ..

Perhaps even:

@register('foo', details_arg='bar', discloseCaller=True)

This would make code which relies on RegisterOptions/SubscribeOptions much more readable, since it keeps the annotations inline instead of requiring a fallback to onJoin callbacks.

@meejah
Copy link
Contributor

meejah commented May 19, 2015

Although not nearly as general as the above, it's possible to set the options for all @register methods in your class by passing an options= arg like self.register(self, options=...) when you do the registration.

Something like the above would be good, though.

@oberstet
Copy link
Contributor

This will land via #824

@oberstet
Copy link
Contributor

ok, landed

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

3 participants