example-multiple-suspension-resumption.rkt

This commit is contained in:
Tony Garnock-Jones 2016-11-29 10:16:39 +13:00
parent 260a99e08b
commit e7402e4387
1 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,13 @@
#lang syndicate/actor
;; Shows that the checks enforcing single-use suspension-resumption are working.
(actor #:name 'shouldnt-work
(field [k #f])
(on-start
(flush!)
(log-info "Result from suspension: ~v"
(react/suspend (actual-k)
(on-start (k actual-k)
((k) 'first-result))))
(flush!)
((k) 'second-result)))