Wiki
Download
Manual
Eggs
API
Tests
Bugs
show
edit
history
You can edit this page using
wiki syntax
for markup.
Article contents:
== Outdated egg! This is an egg for CHICKEN 4, the unsupported old release. You're almost certainly looking for [[/eggref/5/hen|the CHICKEN 5 version of this egg]], if it exists. If it does not exist, there may be equivalent functionality provided by another egg; have a look at the [[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]] == hen --- a beanstalk client [[toc:]] === Description [[http://kr.github.com/beanstalkd/|beanstalk]] is a protocol for interfacing with beanstalkd, a "simple, fast work queue." hen is a simple client for workers and producers === Author Joseph Gay === Requirements [[dsssl-utils]] [[list-utils]] [[miscmacros]] [[tcp6]] === Documentation ==== Examples ===== Worker: <enscript highlight=scheme> (with-hen (tcp-connect "localhost" 11300) (while #t (hen-ignore "default") (hen-watch "my-tube") (let ([job (hen-reserve)]) ; blocks, optional timeout parameter (my-process-job job) (hen-delete ((compose cdr assoc) 'id job))))) </enscript> ===== Producer: <enscript highlight=scheme> (with-hen (tcp-connect "localhost" 11300) (hen-use "my-tube") (hen-put "hello worker!")) </enscript> ==== Procedures <procedure>(with-hen TCP-CONNECTION &FORMS)</procedure> This wrapper procedure is for added convenience. TCP-CONNECTION should be a multi-value as is returned from tcp-connect in [[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. The following are supported beanstalk commands: <procedure>(hen-put [PRI 2^31 [DELAY 0 [TTR 36000]]] data)</procedure> <procedure>(hen-reserve [TIMEOUT #f])</procedure> <procedure>(hen-use TUBE)</procedure> <procedure>(hen-delete ID)</procedure> <procedure>(hen-release ID [PRI 2^31 [DELAY 0]])</procedure> <procedure>(hen-bury ID [PRI 2^31])</procedure> <procedure>(hen-touch ID)</procedure> <procedure>(hen-watch TUBE)</procedure> <procedure>(hen-ignore TUBE)</procedure> <procedure>(hen-peek ID)</procedure> <procedure>(hen-peek-ready)</procedure> <procedure>(hen-peek-delayed)</procedure> <procedure>(hen-peek-buried)</procedure> <procedure>(hen-kick bound)</procedure> <procedure>(hen-stats-job ID)</procedure> <procedure>(hen-stats-tube TUBE)</procedure> <procedure>(hen-stats)</procedure> <procedure>(hen-list-tubes)</procedure> <procedure>(hen-list-tube-used)</procedure> <procedure>(hen-list-tubes-watched)</procedure> <procedure>(hen-quit)</procedure> <procedure>(hen-pause-tube TUBE DELAY)</procedure> 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. 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. === Notes * The structure of return values is subject to change. === Source Source code is available in the eggs repository as well as on github: [[https://github.com/joseph-gay/cscm-hen]] === Version ; 0.7 : Bug fixes for default priority on 32 bit systems and for unconsumed response data (Thanks to Tom Danielson) ; 0.6 : Bug fix for hen-list-tubes-watched, fixed egg dependencies ; 0.5 : Initial release === License Copyright (C) 2011 by Joseph Gay This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description of your changes:
I would like to authenticate
Authentication
Username:
Password:
Spam control
What do you get when you add 11 to 5?