Permalink
Browse files

Have step button on client supersede server threads

  • Loading branch information...
trebb committed May 11, 2012
1 parent 4bfd4e8 commit 93a74288c43063c6318c9055cb07d984c9cfe06c
Showing with 8 additions and 1 deletion.
  1. +8 −1 phoros.lisp
View
@@ -1235,8 +1235,15 @@ linestring stitched together of the nearest auxiliary points from
within radius around coordinates), current-point (the point on
linestring closest to coordinates), and previous-point and next-point
\(points on linestring step-size before and after current-point
-respectively)."
+respectively). Wipe away any unfinished business first."
(assert-authentication)
+ (dolist (old-thread (hunchentoot:session-value 'recent-threads))
+ (ignore-errors
+ (bt:interrupt-thread old-thread
+ #'(lambda () (signal 'superseded)))))
+ (setf (hunchentoot:session-value 'recent-threads) nil)
+ (setf (hunchentoot:session-value 'number-of-threads) 1)
+ (push (bt:current-thread) (hunchentoot:session-value 'recent-threads))
(setf (hunchentoot:content-type*) "application/json")
(let* ((thread-aux-points-function-name
(thread-aux-points-function-name (hunchentoot:session-value

0 comments on commit 93a7428

Please sign in to comment.