Skip to content

Conversation

@Adarsh-jaiss
Copy link
Contributor

Copy link
Contributor

@rnowling-memphis rnowling-memphis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice work @Adarsh-jaiss ! It's very clear and well formatted. Thank you! Some small changes.

await asyncio.sleep(1)
asyncio.run(main())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the blank lines

await memphis.connect(host='localhost', username='user', password='pass')
consumer = await memphis.consumer(station_name='my_station', consumer_name='my_consumer', consumer_group='my_group')
consumer.set_context({'key': 'value'})
consumer.consume(callback=message_handler)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can parameters be passed by name if they are not specified by keyword arguments? Might be safer to remove callback=.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see how I stated that could be confusing. I meant change it to this:

consumer = await memphis.consumer(station_name='my_station', consumer_name='my_consumer', consumer_group='my_group')
consumer.set_context({'key': 'value'})
consumer.consume(message_handler)

- removed the first line and blank lines
- Used the named parameters
Copy link
Contributor

@rnowling-memphis rnowling-memphis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Adarsh-jaiss small miscommunication on my end -- I wasn't clear in my feedback. Sorry about that. Please see my note. Thanks!

await memphis.connect(host='localhost', username='user', password='pass')
consumer = await memphis.consumer(station_name='my_station', consumer_name='my_consumer', consumer_group='my_group')
consumer.set_context({'key': 'value'})
consumer.consume(callback=message_handler)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see how I stated that could be confusing. I meant change it to this:

consumer = await memphis.consumer(station_name='my_station', consumer_name='my_consumer', consumer_group='my_group')
consumer.set_context({'key': 'value'})
consumer.consume(message_handler)

Copy link
Contributor

@rnowling-memphis rnowling-memphis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @Adarsh-jaiss

@rnowling-memphis rnowling-memphis merged commit 2ca64f2 into superstreamlabs:master Jul 16, 2023
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

Successfully merging this pull request may close these issues.

2 participants