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

Allow primative values in responses only #90

Open
pipermerriam opened this issue May 25, 2019 · 0 comments
Open

Allow primative values in responses only #90

pipermerriam opened this issue May 25, 2019 · 0 comments

Comments

@pipermerriam
Copy link
Member

from #89

What was wrong?

It is cumbersome to define a response event for things that have a primative singular value.

How can it be fixed?

We can allow the following primative types to be sent across the wire but only as a response to a request.

  • int
  • float
  • bytes
  • str

We can still package them up in an internal event like this:

class _PrimativeValue(BaseEvent):
    value: Union[int, float, bytes, str]

On the sending side, we only allow sending if the event is accompanied by a BroadcastConfig that defines filter_event_id and filter_endpoint.

On the receiving side, we unwrap the value if these conditions are met. This looks like this will require unwrapping in _process_item which means our various queues and things will have to have flexible type hints for the mechanisms where we're sending things to subscription handlers, futures, etc.

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