Skip to content
Go Beanstalkd Client Library
Branch: master
Clone or download
iwanbk Coveralls.io integration (#15)
* Add coveralls.io integration

* Add coveralls.io badge
Latest commit dbbb239 Sep 3, 2016
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore ignore tags file Apr 11, 2012
.travis.yml Coveralls.io integration (#15) Sep 3, 2016
LICENSE Update list of supported commands Sep 3, 2016
README.md Coveralls.io integration (#15) Sep 3, 2016
ReleaseNotes.txt release notes for v0.3 Jun 24, 2014
gobeanstalk.go Export error type. Sep 3, 2016
gobeanstalk_test.go Export error type. Sep 3, 2016

README.md

#gobeanstalk Build Status GoDoc Coverage Status

Go Beanstalkd client library.

INSTALL

go get github.com/iwanbk/gobeanstalk

USAGE

Producer

import (
	"github.com/iwanbk/gobeanstalk"
	"log"
	"time"
)

func main() {
	conn, err := gobeanstalk.Dial("localhost:11300")
	if err != nil {
		log.Fatal(err)
	}

	id, err := conn.Put([]byte("hello"), 0, 10*time.Second, 30*time.Second)
	if err != nil {
		log.Fatal(err)
	}

	log.Printf("Job id %d inserted\n", id)
}

Consumer

import (
	"github.com/iwanbk/gobeanstalk"
	"log"
)

func main() {
	conn, err := gobeanstalk.Dial("localhost:11300")
	if err != nil {
		log.Fatal(err)
	}
	for {
		j, err := conn.Reserve()
		if err != nil {
			log.Fatal(err)
		}
		log.Printf("id:%d, body:%s\n", j.ID, string(j.Body))
		err = conn.Delete(j.ID)
		if err != nil {
			log.Fatal(err)
		}
	}
}

Implemented Commands

  • use
  • put
  • watch
  • ignore
  • reserve
  • delete
  • touch
  • release
  • bury
  • kick
  • kick-job
  • list-tubes
  • stats
  • stats-tube
  • stats-job
  • quit

Release Notes

Latest release is v0.3 that contains API changes, see release notes here

Author

You can’t perform that action at this time.