Skip to content

Commit

Permalink
Add support for clsql
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Palmucci committed Jul 13, 2009
1 parent 06d4dc4 commit a1db1c0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README
Expand Up @@ -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. (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.
4 changes: 4 additions & 0 deletions cl-future.asd
Expand Up @@ -14,6 +14,10 @@
:perform (asdf:load-op :after (op c) :perform (asdf:load-op :after (op c)
(if (find-package 'swank) (if (find-package 'swank)
(load (make-pathname :name "future-swank" (load (make-pathname :name "future-swank"
:type "lisp"
:defaults *future-path*)))
(if (find-package 'clsql)
(load (make-pathname :name "future-clsql"
:type "lisp" :type "lisp"
:defaults *future-path*))))) :defaults *future-path*)))))


Expand Down
8 changes: 8 additions & 0 deletions future-clsql.lisp
@@ -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*)
2 changes: 1 addition & 1 deletion future.lisp
Expand Up @@ -59,7 +59,7 @@ When wait comes around and reaps them, we remove them from the table"




(defun terminate-children () (defun terminate-children ()
"Kill all currently runnint children" "Kill all currently running children."
(maphash #'(lambda (key value) (maphash #'(lambda (key value)
(with-slots (pid result code) value (with-slots (pid result code) value
(ignore-errors (nix:kill (pid value) 9)) (ignore-errors (nix:kill (pid value) 9))
Expand Down

0 comments on commit a1db1c0

Please sign in to comment.