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

Deprecate 'Sub' in favor of more general 'Ctl' #53

Open
jsccast opened this issue Mar 8, 2021 · 0 comments
Open

Deprecate 'Sub' in favor of more general 'Ctl' #53

jsccast opened this issue Mar 8, 2021 · 0 comments

Comments

@jsccast
Copy link
Member

jsccast commented Mar 8, 2021

A suggestion from @robertfarnum:

Introduce a Ctl method for Chan. Different channel types (e.g., MQTT, HTTPServer) can then support different Ctl requests. For example, the MQTT channel type should support subscribe and unsubscribe.

Currently, for several channel types, the method Sub will return a "not implemented" error. In other words, Sub doesn't make sense for many channel types. Also the corresponding Unsub (for "unsubscribe"), which does make sense for an MQTT client is not actually available today. In this proposal, the MQTT channel would support a "subscribe" Ctl request and an "unsubscribe" Ctl request. Possible example of the former:

- ctl:
    subscribe:
      topic: 'foo/+'
      qos 1

(Might want an explicit payload?)

How would a test get the results of that call? Perhaps via the usual Recv mechanism on a designed topic (e.g., ctl)?

- recv:
    topic: ctl
    pattern:
      success: true

?

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

No branches or pull requests

1 participant