Permalink
Browse files

Add support for clsql

  • Loading branch information...
1 parent 06d4dc4 commit a1db1c01711784ef6bf8664d178668b80c1561ce Jeff Palmucci committed Jul 13, 2009
Showing with 16 additions and 2 deletions.
  1. +3 −1 README
  2. +4 −0 cl-future.asd
  3. +8 −0 future-clsql.lisp
  4. +1 −1 future.lisp
View
4 README
@@ -8,4 +8,6 @@ Interface:
(get-future-value <expr>): walk the list structure "expr", replacing any futures with their evaluated values. Blocks if a future is still running.
-*total-slaves*: The maximum number of slaves to run at any one time.
+*total-slaves*: The maximum number of slaves to run at any one time.
+
+(terminate-children): Kill all currently running children.
View
@@ -15,6 +15,10 @@
(if (find-package 'swank)
(load (make-pathname :name "future-swank"
:type "lisp"
+ :defaults *future-path*)))
+ (if (find-package 'clsql)
+ (load (make-pathname :name "future-clsql"
+ :type "lisp"
:defaults *future-path*)))))
View
@@ -0,0 +1,8 @@
+(in-package :future)
+
+;; If we are using clsql, make sure to close the connections in the child lest the server get confused.
+(defun close-clsql-connections ()
+ (clsql:disconnect)
+ )
+
+(pushnew #'close-clsql-connections *spawn-child-hooks*)
View
@@ -59,7 +59,7 @@ When wait comes around and reaps them, we remove them from the table"
(defun terminate-children ()
- "Kill all currently runnint children"
+ "Kill all currently running children."
(maphash #'(lambda (key value)
(with-slots (pid result code) value
(ignore-errors (nix:kill (pid value) 9))

0 comments on commit a1db1c0

Please sign in to comment.