summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2010-12-04 11:18:19 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2010-12-04 11:18:19 -0500
commit92633f7b7303c6566dbec24b8e20721f25d7e051 (patch)
treea56cf4149072b1d03ca38726de9c530be61183c2 /doc
parent5e90aecd290f5ae8b4b10367cc0d8995be2a1d9d (diff)
Update manual to track uw_register_transactional() change
Diffstat (limited to 'doc')
-rw-r--r--doc/manual.tex5
1 files changed, 3 insertions, 2 deletions
diff --git a/doc/manual.tex b/doc/manual.tex
index ef096356..6b994f19 100644
--- a/doc/manual.tex
+++ b/doc/manual.tex
@@ -2139,10 +2139,11 @@ void *uw_malloc(uw_context, size_t);
\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.