Comcast / Comcast/plax

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

Open
#53 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
8
Forks
13
PR merge metrics
No merged PRs in 30d

Description

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:

```YAML
- 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`)?

```YAML
- recv:
topic: ctl
pattern:
success: true
```

?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.