-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calling (update mywidget) from a new thread #6
Comments
There are two problems with this code. To make the session variable available in the new thread, you need to provide initial bindings to a new thread like that: CL-USER> (let ((weblocks/session::*session* :test-value))
(bt:make-thread (lambda ()
(format t "Session in thread: ~A~%"
weblocks/session::*session*))))
Session in thread: NIL but CL-USER> (let ((weblocks/session::*session* :test-value))
(bt:make-thread (lambda ()
(format t "Session in thread: ~A~%"
weblocks/session::*session*))
:initial-bindings
(list* (cons 'weblocks/session::*session*
weblocks/session::*session*)
bt:*default-special-bindings*)))
Session in thread: TEST-VALUE However, this will not solve the second issue: When you'll call the When you call to action and Currently, this task only can be done with a WebSocket. |
Got it. https://github.com/40ants/weblocks-websocket did the job |
How to make a new thread aware of the session it was created from ?
complete executable code to illustrate the problem: https://gist.github.com/bamboospirit/e6ad95503ec40d2c7649f4aa14ad4979#file-thr-update-lisp
The text was updated successfully, but these errors were encountered: