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

In subscribe, run a callback instead of printing the message. #83

Closed
rdt12 opened this issue Jun 29, 2020 · 3 comments
Closed

In subscribe, run a callback instead of printing the message. #83

rdt12 opened this issue Jun 29, 2020 · 3 comments
Assignees

Comments

@rdt12
Copy link
Contributor

rdt12 commented Jun 29, 2020

Description

As a developer, I would like to use the scaffolding provided by the subscribe module and run my own code instead of printing the message.

There are a number of ways to accomplish this. Here are two examples::

  1. factor the code out of _main into a new function, say guts, and have _main and a new function named, say subscribe call guts with a callback function. _main could use print_message as the callback

  2. Add a callback argument to _main that defaults to print_message.

Definition of Done

A test program is written that defines a callback and ensures that the callback is called.

@myNameIsPatrick
Copy link
Collaborator

@rdt12, just wanted to check in to see if you think there's still value in doing something like this after #82, which drastically simplified the subscribe main code (https://github.com/scimma/hop-client/blob/master/hop/subscribe.py#L49-L59).

@rdt12 rdt12 self-assigned this Oct 8, 2020
@rdt12
Copy link
Contributor Author

rdt12 commented Oct 8, 2020

@myNameIsPatrick I guess I haven't looked at the code since July. It looks like most of the details are now buried in the io.Stream class so I agree that there is no point to this and it can be closed.

@rdt12
Copy link
Contributor Author

rdt12 commented Oct 8, 2020

Based on my last comment, closing this issue.

@rdt12 rdt12 closed this as completed Oct 8, 2020
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

2 participants