Skip to content

retrying in storehaus should be a little more configurable #99

@softprops

Description

@softprops

The recent addition of retry-able stores was nice but I think the way a client wants to retry should be a little more configurable.

Some interfaces where retry apis shine are

I talked to @n8han, the author of dispatch, about extracting his interface which seems to be the most generic and he said it'd be cool. I hate to see this kind of thing be reinvented in multiple contexts so I created a standalone retry library based on the one in reboot.

The problems I face now are

  1. the retry lib is based on scala's future interface, only available in 2.9.3 and 2.10+. Storehaus is published for 2.9.2 and 2.10 which means if I wanted to adapt this interface to storehaus I could only do it in modules published for 2.10.

  2. The retry lib works with scala futures while storehaus is based on twttr futures. Scala's interface looks like it stole a lot from twitter so a bijection between the two should hopefully be the fix but I'd had to figure out a good way of handling the 2.9.2 case.

  3. The retry lib needs to emulate sleeping asynchronously to simulate a pause between retries. Dispatch reboot uses netty's hashwheel timer to put a block of code on a timer. Twitter defines its own Timer interface. ( The zookeeper lib uses this ). In order to integrate a generic retry lib, a common retry interface would be required. This should not be hard. Potentially something like this should suffice.

  4. Is storehaus open to non-twitter published dependencies? Since the retry library is outside the twitter lib lifecycle it could go in its own module storehaus. I publish everything to maven central so resolving should not be an issue.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions