Skip to content

Instantly share code, notes, and snippets.

@nvllsvm
Last active August 6, 2019 07:12
Show Gist options
  • Save nvllsvm/65e5f78347fa58f7e48dcafa0bef1c0c to your computer and use it in GitHub Desktop.
Save nvllsvm/65e5f78347fa58f7e48dcafa0bef1c0c to your computer and use it in GitHub Desktop.
version: '2.4'
services:
example:
image: python:alpine
command: ['sh', '-c', 'pip install rabbitpy && python /example/example.py']
volumes:
- ./:/example
rabbitmq:
image: rabbitmq:alpine
ports:
- 5672:5672
- 15672:15672
import rabbitpy
import sys
import time
if sys.platform == 'darwin':
url = 'amqp://guest:guest@localhost:5672/%2f'
else:
url = 'amqp://guest:guest@rabbitmq:5672/%2f'
conn = rabbitpy.Connection(url)
channel = conn.channel()
# manually enable this later
## channel.enable_publisher_confirms()
while True:
print('Publishing!')
message = rabbitpy.Message(channel, b'content')
message.publish('amq.topic', 'rk')
time.sleep(5)
@gmr
Copy link

gmr commented Aug 6, 2019

There's not a missing timeout, as the timeout value is the same for READ, WRITE, and ERROR:

https://github.com/gmr/rabbitpy/blob/master/rabbitpy/io.py#L85

it's the difference between kqueue and poll. I've not been in this code for some time, but it's likely around event registration and may even be a Python level bug. I'm poking around on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment