Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
doc:plans [2014/01/21 10:32] – [with-policy] winklerdoc:plans [2014/01/21 10:34] – [with-policy] winkler
Line 59: Line 59:
          (retry))) ;; Or whatever seems appropriate in your use-case          (retry))) ;; Or whatever seems appropriate in your use-case
     (with-named-policy 'my-policy (10 5)     (with-named-policy 'my-policy (10 5)
-      (loop do (format t "Main loop cRight now, just a `timeout-policy` is available that the given `body` stops code after a given amount of time (in seconds) if it hasn't finished by then. +      (loop do (format t "Main loop cycle.~%")
- +
-Use it like this: +
-```lisp +
-(with-policy cpl:timeout-policy (5.0) +
-  (body-code-goes-here)) +
-``` +
-And for catching the check condition when the timeout actually happens: +
-```lisp +
-(with-failure-handling +
-    ((policy-check-condition-met (f) +
-      (declare (ignore f)) +
-      (handle-error-here-and-maybe-retry))) +
-  (with-policy cpl:timeout-policy (5.0) +
-    (body-code-goes-here))) +
-```ycle.~%")+
                (sleep 2)))))                (sleep 2)))))
 </code> </code>