Polyconseil / aioamqp

AMQP implementation using asyncio
Other
280 stars 88 forks source link

Create new task for devlier callbacks instead of call a blocking call #92

Closed timofurrer closed 8 years ago

timofurrer commented 8 years ago

I submitted the issue #87 some days ago. I managed to consume from multiple queues with multiple open channels. This bothered me a little. Why don't we just run the callback with loop.call_soon ? I made this little change and tested with my code which waits for a response of a command (RPC) in a received event and it works fine. (I'm basically consuming from the response and event queue at the "same time" ...)

Do you guys see any problems with this fix?

foolswood commented 8 years ago

It doesn't wait for one element of the queue to be handled before moving on to the next within a single queue. Not sure order is guaranteed to be preserved either.

dzen commented 8 years ago

This really shows how the callback design was not a great choice ..

timofurrer commented 8 years ago

@foolswood Oh yeah, I agree. @dzen Okay, it was not a perfect choice ... what next? Do you have anything in mind on how to solve this issue?

dzen commented 8 years ago

@timofurrer : as said in another issue (and we should / have to spec it in a real issue) we should imagine how the API should be. We're currently have a lots of release incoming here @polyconseil but we're aware of this huge issue

RemiCardona commented 8 years ago

This creates untracked Task objects and is a big no-no in my book, so this PR is unmergeable as-is. Let's all go back to the drawing board in #87 and cleanly figure it out.

Cheers