docker / go-events

Composable event distribution for Go
Apache License 2.0
133 stars 23 forks source link

[WIP] queue: Return an error when Close is called before the destination is closed #16

Closed aaronlehmann closed 7 years ago

aaronlehmann commented 8 years ago

Closing the queue before its destination can otherwise cause a deadlock, because the destination can be stuck in a write.

This causes TestQueue to fail because it expects all events to get written to the sink, but by (correctly) closing the sink before the queue, that ends up not being the case. I'm not sure whether this PR is the right approach.

aaronlehmann commented 8 years ago

Rebased, and fixed the crappy Done functions.

Still not sure what should be done about TestQueue, or whether this is the right approach.