# HG changeset patch # User Adam Chlipala # Date 1291479499 18000 # Node ID c5799b1e4c584205df82b124364ddcdd7f0b882d # Parent 1cc67fdac4d3c44de91c86a7f16c29c930b8d1fa Update manual to track uw_register_transactional() change diff -r 1cc67fdac4d3 -r c5799b1e4c58 doc/manual.tex --- a/doc/manual.tex Sat Dec 04 11:15:20 2010 -0500 +++ b/doc/manual.tex Sat Dec 04 11:18:19 2010 -0500 @@ -2139,10 +2139,11 @@ \item \begin{verbatim} typedef void (*uw_callback)(void *); +typedef void (*uw_callback_with_retry)(void *, int will_retry); void uw_register_transactional(uw_context, void *data, uw_callback commit, - uw_callback rollback, uw_callback free); + uw_callback rollback, uw_callback_with_retry free); \end{verbatim} - All side effects in Ur/Web programs need to be compatible with transactions, such that any set of actions can be undone at any time. Thus, you should not perform actions with non-local side effects directly; instead, register handlers to be called when the current transaction is committed or rolled back. The arguments here give an arbitary piece of data to be passed to callbacks, a function to call on commit, a function to call on rollback, and a function to call afterward in either case to clean up any allocated resources. A rollback handler may be called after the associated commit handler has already been called, if some later part of the commit process fails. + All side effects in Ur/Web programs need to be compatible with transactions, such that any set of actions can be undone at any time. Thus, you should not perform actions with non-local side effects directly; instead, register handlers to be called when the current transaction is committed or rolled back. The arguments here give an arbitary piece of data to be passed to callbacks, a function to call on commit, a function to call on rollback, and a function to call afterward in either case to clean up any allocated resources. A rollback handler may be called after the associated commit handler has already been called, if some later part of the commit process fails. A free handler is told whether the runtime system expects to retry the current page request after rollback finishes. Any of the callbacks may be \texttt{NULL}. To accommodate some stubbornly non-transactional real-world actions like sending an e-mail message, Ur/Web treats \texttt{NULL} \texttt{rollback} callbacks specially. When a transaction commits, all \texttt{commit} actions that have non-\texttt{NULL} rollback actions are tried before any \texttt{commit} actions that have \texttt{NULL} rollback actions. Thus, if a single execution uses only one non-transactional action, and if that action never fails partway through its execution while still causing an observable side effect, then Ur/Web can maintain the transactional abstraction.