chrisdinn / brando

A Redis client written with Akka's IO package
Other
107 stars 24 forks source link

Migration guide from v2 to v3 #60

Closed KarelCemus closed 8 years ago

KarelCemus commented 8 years ago

Previous versions of brando implemented Akka Stash and queued requests when the redis was not connected. As part of #46 this behavior was silently dropped and version 3 throws an exception instead, which is significantly different behavior.

  1. I suggest to document this change because I spent several hours debugging why the application is not working after the upgrade.
  2. It would be wonderful to provide some kind of migration guide or and simple option to re-enable this behavior. I really miss it. In asynchronous connection, I don't really think it must be handled by the application itself if the connection can be (re-)establish within a certain timeout.

Thanks!

damienlevin commented 8 years ago

Sorry for the inconvenience caused by the change, this should have been documented. I don't think it is the responsibility of the library to stash messages, or at least not in the way it was implemented before (not configurable, not bounded) As an alternative I suggest you use an actor to stash messages based on the connection states (https://github.com/chrisdinn/brando/blob/master/src/main/scala/Connection.scala#L16). You can either use Akka stash with a bounded mailbox or implement your own bounded queue.

Feel free to submit a PR for a migration guide.

Thanks

KarelCemus commented 8 years ago

Thanks for the hint. I'll look at it and try to figure out the solution because I had to stay with v2. If I figure out smooth integration with the current Brando implementation I'll submit a PR.