Programming Concurrency on the JVM (for jay muratore) by Venkat Subramaniam

Programming Concurrency on the JVM (for jay muratore) by Venkat Subramaniam

Author:Venkat Subramaniam
Language: eng
Format: epub
Tags: Pragmatic Bookshelf
ISBN: 978-1-934356-76-0
Publisher: The Pragmatic Bookshelf, LLC (306009)


6.11 Blocking Transactions—Sensible Wait

A transaction may depend on a variable that’s expected to change, and the failure of the transaction may be temporary. As a response to that failure, we may return an error code and ask the transaction to retry after a delay. However, there’s no point repeating the request until another task has changed the dependent data. Akka gives us a simple facility, retry, which will roll back and block the transaction until one of the reference objects the transaction depends on changes or the configurable block timeout is exceeded. I like to call this a “sensible wait” because that sounds better than “blocking.” Let’s put blocking, I mean sensible wait, to use in an example in Java first and then in Scala.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.