michaelmmacleod
2020-4-25 23:28:55

edit: solved, see bottom of message.

I’m trying to leverage web-server’s stateless servlet code to create a DSL with serializable continuations, but I’m running into trouble when invoking call-with-serializable-current-continuation . Specifically, I get the error current-continuation-marks: continuation includes no prompt with the given tag tag: #<continuation-prompt-tag> from the following code: #lang web-server/base (require (only-in racket/serialize serialize) (only-in web-server/lang/abort-resume call-with-serializable-current-continuation)) (call-with-serializable-current-continuation (lambda (k) (serialize k))) My overall goal is to use call-with-serializable-current-continuation to periodically capture and store (to disk) the state of a running program so that I can stop it and resume it later.

edit: It looks like call-with-serializable-current-continuation expects the current continuation to have a continuation mark with a web-prompt key. This can be introduced with call-with-web-prompt: #lang web-server/base (require (only-in racket/serialize serialize) (only-in web-server/lang/abort-resume call-with-serializable-current-continuation call-with-web-prompt )) (call-with-web-prompt (lambda () (call-with-serializable-current-continuation (lambda (k) (serialize k)))))