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

add: wrapper for Queue #4

Closed
metaist opened this issue May 5, 2023 · 3 comments
Closed

add: wrapper for Queue #4

metaist opened this issue May 5, 2023 · 3 comments

Comments

@metaist
Copy link
Owner

metaist commented May 5, 2023

It's a little awkward calling ezq.put_msg and ezq.iter_msg. I think I'd prefer:

q = ezq.Q() # simple constructor
q.put(data, kind='special', order=1)  # constructs the message

for msg in q: # simple iteration
    # something with msg.data

q.end()
@metaist
Copy link
Owner Author

metaist commented May 5, 2023

A quick test suggests this is kinda nice. Maybe I like this better than the functions.

@metaist
Copy link
Owner Author

metaist commented May 5, 2023

Why not both? Because idioms matter and the examples will be what people remember.

Ok, but why not both, under-the-hood. Like keep the functions as the primitive operations, but include the wrappers for convenience.

Maybe. Will probably keep both for a little bit to see what it's like.

@metaist
Copy link
Owner Author

metaist commented May 5, 2023

Of course now the functions for creating the workers and ending them feel weird.

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