salemove / freddy

Messaging api supporting request-response and acknowledgements.
MIT License
9 stars 0 forks source link

Fix race condition in wait_for_response #42

Closed indrekj closed 8 years ago

indrekj commented 8 years ago

If the response is already received then just returned it. There's no reason to wait for resource signal.

indrekj commented 8 years ago

updated

indrekj commented 8 years ago

Got rid of on_timeout setter. send_and_wait_response_producer could use some refactoring but I'd rather not do it at the moment.

stenver commented 8 years ago

+1

indrekj commented 8 years ago

@willmore Updated

willmore commented 8 years ago

I see you added delivery.payload.nil? but shouldn't there minimally be a nil check in call? Unless sync_response_container is a private class, it shouldn't trust the input from a caller.

indrekj commented 8 years ago

Oh, you meant adding it to #call, I thought you meant the guy who calls #call

indrekj commented 8 years ago

@willmore updated again

willmore commented 8 years ago

+1