{"id":27881838,"url":"https://github.com/src-d/go-queue","last_synced_at":"2025-05-05T05:05:38.321Z","repository":{"id":57493760,"uuid":"132619976","full_name":"src-d/go-queue","owner":"src-d","description":" Queue is a generic interface to abstract the details of implementation of queue systems.","archived":false,"fork":false,"pushed_at":"2020-04-27T15:45:40.000Z","size":106,"stargazers_count":47,"open_issues_count":0,"forks_count":14,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-05-05T05:05:32.806Z","etag":null,"topics":["amqp","generic-interface","golang","in-memory","queues"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/src-d.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-08T14:20:32.000Z","updated_at":"2024-09-22T00:17:36.000Z","dependencies_parsed_at":"2022-08-30T02:20:55.643Z","dependency_job_id":null,"html_url":"https://github.com/src-d/go-queue","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/src-d%2Fgo-queue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/src-d%2Fgo-queue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/src-d%2Fgo-queue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/src-d%2Fgo-queue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/src-d","download_url":"https://codeload.github.com/src-d/go-queue/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252442486,"owners_count":21748451,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amqp","generic-interface","golang","in-memory","queues"],"created_at":"2025-05-05T05:05:37.799Z","updated_at":"2025-05-05T05:05:38.306Z","avatar_url":"https://github.com/src-d.png","language":"Go","readme":"# go-queue [![GoDoc](https://godoc.org/gopkg.in/src-d/go-queue.v1?status.svg)](https://godoc.org/github.com/src-d/go-queue) [![Build Status](https://travis-ci.org/src-d/go-queue.svg)](https://travis-ci.org/src-d/go-queue) [![Build status](https://ci.appveyor.com/api/projects/status/15cdr1nk890qpk7g?svg=true)](https://ci.appveyor.com/project/mcuadros/go-queue-5ncaj) [![codecov.io](https://codecov.io/github/src-d/go-queue/coverage.svg)](https://codecov.io/github/src-d/go-queue) [![Go Report Card](https://goreportcard.com/badge/github.com/src-d/go-queue)](https://goreportcard.com/report/github.com/src-d/go-queue)\n\nQueue is a generic interface to abstract the details of implementation of queue\nsystems.\n\nSimilar to the package [`database/sql`](https://golang.org/pkg/database/sql/),\nthis package implements a common interface to interact with different queue\nsystems, in a unified way.\n\nCurrently, only AMQP queues and an in-memory queue are supported.\n\nInstallation\n------------\n\nThe recommended way to install *go-queue* is:\n\n```\ngo get -u gopkg.in/src-d/go-queue.v1/...\n```\n\nUsage\n-----\n\nThis example shows how to publish and consume a Job from the in-memory\nimplementation, very useful for unit tests.\n\nThe queue implementations to be supported by the `NewBroker` should be imported\nas shows the example.\n\n```go\nimport (\n    ...\n\t\"gopkg.in/src-d/go-queue.v1\"\n\t_ \"gopkg.in/src-d/go-queue.v1/memory\"\n)\n\n...\n\nb, _ := queue.NewBroker(\"memory://\")\nq, _ := b.Queue(\"test-queue\")\n\nj, _ := queue.NewJob()\nif err := j.Encode(\"hello world!\"); err != nil {\n    log.Fatal(err)\n}\n\nif err := q.Publish(j); err != nil {\n    log.Fatal(err)\n}\n\niter, err := q.Consume(1)\nif err != nil {\n    log.Fatal(err)\n}\n\nconsumedJob, _ := iter.Next()\n\nvar payload string\n_ = consumedJob.Decode(\u0026payload)\n\nfmt.Println(payload)\n// Output: hello world!\n```\n\n\nConfiguration\n-------------\n\n### AMQP\n\nThe list of available variables is:\n\n- `AMQP_BACKOFF_MIN` (default: 20ms): Minimum time to wait for retry the connection or queue channel assignment.\n- `AMQP_BACKOFF_MAX` (default: 30s): Maximum time to wait for retry the connection or queue channel assignment.\n- `AMQP_BACKOFF_FACTOR` (default: 2): Multiplying factor for each increment step on the retry.\n- `AMQP_BURIED_QUEUE_SUFFIX` (default: `.buriedQueue`): Suffix for the buried queue name.\n- `AMQP_BURIED_EXCHANGE_SUFFIX` (default: `.buriedExchange`): Suffix for the exchange name.\n- `AMQP_BURIED_TIMEOUT` (default: 500): Time in milliseconds to wait for new jobs from the buried queue.\n- `AMQP_RETRIES_HEADER` (default: `x-retries`): Message header to set the number of retries.\n- `AMQP_ERROR_HEADER` (default: `x-error-type`): Message header to set the error type.\n\nLicense\n-------\nApache License Version 2.0, see [LICENSE](LICENSE)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrc-d%2Fgo-queue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsrc-d%2Fgo-queue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrc-d%2Fgo-queue/lists"}