((section 2 "Outdated egg!" (p "This is an egg for CHICKEN 4, the unsupported old release.  You're almost certainly looking for " (int-link "/eggref/5/hen" "the CHICKEN 5 version of this egg") ", if it exists.") (p "If it does not exist, there may be equivalent functionality provided by another egg; have a look at the " (link "https://wiki.call-cc.org/chicken-projects/egg-index-5.html" "egg index") ". Otherwise, please consider porting this egg to the current version of CHICKEN.") (tags "egg")) (section 2 "hen --- a beanstalk client" (toc) (section 3 "Description" (p (link "http://kr.github.com/beanstalkd/" "beanstalk") " is a protocol for interfacing with beanstalkd, a \"simple, fast work queue.\"") (p "hen is a simple client for workers and producers")) (section 3 "Author" (p "Joseph Gay")) (section 3 "Requirements" (p (int-link "dsssl-utils")) (p (int-link "list-utils")) (p (int-link "miscmacros")) (p (int-link "tcp6"))) (section 3 "Documentation" (section 4 "Examples" (section 5 "Worker:" (highlight scheme "(with-hen (tcp-connect \"localhost\" 11300)\n  (while #t         \n    (hen-ignore \"default\")\n    (hen-watch \"my-tube\")\n    (let ([job (hen-reserve)]) ; blocks, optional timeout parameter\n      (my-process-job job)\n      (hen-delete ((compose cdr assoc) 'id job)))))")) (section 5 "Producer:" (highlight scheme "(with-hen (tcp-connect \"localhost\" 11300)\n  (hen-use \"my-tube\")\n  (hen-put \"hello worker!\"))"))) (section 4 "Procedures" (def (sig (procedure "(with-hen TCP-CONNECTION &FORMS)" (id with-hen))) (p "This wrapper procedure is for added convenience. TCP-CONNECTION should be a multi-value as is returned from tcp-connect in " (int-link "tcp6") ". with-hen is used as in the examples above. It will automatically call hen-quit and return the value of the last form provided to be evaluated.") (p "The following are supported beanstalk commands:")) (def (sig (procedure "(hen-put [PRI 2^31 [DELAY 0 [TTR 36000]]] data)" (id hen-put)))) (def (sig (procedure "(hen-reserve [TIMEOUT #f])" (id hen-reserve)))) (def (sig (procedure "(hen-use TUBE)" (id hen-use)))) (def (sig (procedure "(hen-delete ID)" (id hen-delete)))) (def (sig (procedure "(hen-release ID [PRI 2^31 [DELAY 0]])" (id hen-release)))) (def (sig (procedure "(hen-bury ID [PRI 2^31])" (id hen-bury)))) (def (sig (procedure "(hen-touch ID)" (id hen-touch)))) (def (sig (procedure "(hen-watch TUBE)" (id hen-watch)))) (def (sig (procedure "(hen-ignore TUBE)" (id hen-ignore)))) (def (sig (procedure "(hen-peek ID)" (id hen-peek)))) (def (sig (procedure "(hen-peek-ready)" (id hen-peek-ready)))) (def (sig (procedure "(hen-peek-delayed)" (id hen-peek-delayed)))) (def (sig (procedure "(hen-peek-buried)" (id hen-peek-buried)))) (def (sig (procedure "(hen-kick bound)" (id hen-kick)))) (def (sig (procedure "(hen-stats-job ID)" (id hen-stats-job)))) (def (sig (procedure "(hen-stats-tube TUBE)" (id hen-stats-tube)))) (def (sig (procedure "(hen-stats)" (id hen-stats)))) (def (sig (procedure "(hen-list-tubes)" (id hen-list-tubes)))) (def (sig (procedure "(hen-list-tube-used)" (id hen-list-tube-used)))) (def (sig (procedure "(hen-list-tubes-watched)" (id hen-list-tubes-watched)))) (def (sig (procedure "(hen-quit)" (id hen-quit)))) (def (sig (procedure "(hen-pause-tube TUBE DELAY)" (id hen-pause-tube))) (p "Most of the commands will return a simple string status. Exceptions are the stats commands, which return an alist, and the reserve command, which returns a pair (job-id . data) if a job is reserved.") (p "All hen commands also accept keyword arguments #:tcp-in and #:tcp-out to override hen-in and hen-out, which are the default ports, initially unspecified.")))) (section 3 "Notes" (ul (li "The structure of return values is subject to change. "))) (section 3 "Source" (p "Source code is available in the eggs repository as well as on github: " (link "https://github.com/joseph-gay/cscm-hen"))) (section 3 "Version" (dl (dt "0.7") (dd "Bug fixes for default priority on 32 bit systems and for unconsumed response data (Thanks to Tom Danielson)") (dt "0.6") (dd "Bug fix for hen-list-tubes-watched, fixed egg dependencies") (dt "0.5") (dd "Initial release"))) (section 3 "License" (pre " Copyright (C) 2011 by Joseph Gay\n\n This program is free software; you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation; either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program; if not, write to the Free Software\n Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA"))))