Skip to content

Instantly share code, notes, and snippets.

@orthecreedence
Created November 6, 2012 22:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save orthecreedence/4028147 to your computer and use it in GitHub Desktop.
Save orthecreedence/4028147 to your computer and use it in GitHub Desktop.
(defun sleeper ()
(let ((f1 (green-threads:make-future)))
(as:delay (lambda () (complete-future f1 'hai)) :time 3)
f1))
(defun app ()
(with-green-thread
(format t "start sleeper~%")
(format t "end sleeper: ~a~%" (wait-on (sleeper)))))
(as:start-event-loop
(lambda ()
(format t "start app~%")
(app)
(format t "end app~%")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment