Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Gopher Celery 🥬

[![Documentation](https://godoc.org/github.com/marselester/gopher-celery?status.svg)](https://pkg.go.dev/github.com/marselester/gopher-celery)
[![Go Report Card](https://goreportcard.com/badge/github.com/marselester/gopher-celery)](https://goreportcard.com/report/github.com/marselester/gopher-celery)
[![Documentation](https://godoc.org/github.com/lagerstrom/gopher-celery?status.svg)](https://pkg.go.dev/github.com/lagerstrom/gopher-celery)
[![Go Report Card](https://goreportcard.com/badge/github.com/lagerstrom/gopher-celery)](https://goreportcard.com/report/github.com/lagerstrom/gopher-celery)

The objective of this project is to provide
the very basic mechanism to efficiently produce and consume Celery tasks on Go side.
Expand Down
4 changes: 2 additions & 2 deletions bench-old.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
goos: darwin
goarch: amd64
pkg: github.com/marselester/gopher-celery/internal/protocol
pkg: github.com/lagerstrom/gopher-celery/internal/protocol
cpu: Intel(R) Core(TM) i5-10600 CPU @ 3.30GHz
BenchmarkJSONSerializerEncode_v2NoParams-12 405000379 2.960 ns/op 0 B/op 0 allocs/op
BenchmarkJSONSerializerEncode_v2NoParams-12 403379344 2.970 ns/op 0 B/op 0 allocs/op
Expand Down Expand Up @@ -83,4 +83,4 @@ BenchmarkJSONSerializerEncode_v1ArgsKwargs-12 646405 1768 ns/op
BenchmarkJSONSerializerEncode_v1ArgsKwargs-12 660436 1771 ns/op 1001 B/op 10 allocs/op
BenchmarkJSONSerializerEncode_v1ArgsKwargs-12 668602 1773 ns/op 1001 B/op 10 allocs/op
PASS
ok github.com/marselester/gopher-celery/internal/protocol 115.912s
ok github.com/lagerstrom/gopher-celery/internal/protocol 115.912s
6 changes: 4 additions & 2 deletions celery.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"github.com/google/uuid"
"golang.org/x/sync/errgroup"

"github.com/marselester/gopher-celery/protocol"
"github.com/marselester/gopher-celery/redis"
"github.com/lagerstrom/gopher-celery/protocol"
"github.com/lagerstrom/gopher-celery/redis"
)

// TaskF represents a Celery task implemented by the client.
Expand Down Expand Up @@ -286,6 +286,7 @@ type contextKey int
const (
// ContextKeyTaskName is a context key to access task names.
ContextKeyTaskName contextKey = iota
ContextKeyTaskId
)

// executeTask calls the task function with args and kwargs from the message.
Expand All @@ -304,6 +305,7 @@ func (a *App) executeTask(ctx context.Context, m *protocol.Task) (err error) {
}

ctx = context.WithValue(ctx, ContextKeyTaskName, m.Name)
ctx = context.WithValue(ctx, ContextKeyTaskId, m.ID)
p := NewTaskParam(m.Args, m.Kwargs)
return task(ctx, p)
}
6 changes: 3 additions & 3 deletions celery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (

"github.com/go-kit/log"

"github.com/marselester/gopher-celery/goredis"
"github.com/marselester/gopher-celery/protocol"
"github.com/marselester/gopher-celery/rabbitmq"
"github.com/lagerstrom/gopher-celery/goredis"
"github.com/lagerstrom/gopher-celery/protocol"
"github.com/lagerstrom/gopher-celery/rabbitmq"
)

func TestExecuteTaskPanic(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package celery
import (
"github.com/go-kit/log"

"github.com/marselester/gopher-celery/protocol"
"github.com/lagerstrom/gopher-celery/protocol"
)

// DefaultMaxWorkers is the default upper limit of goroutines
Expand Down
6 changes: 3 additions & 3 deletions examples/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module github.com/marselester/gopher-celery/examples
module github.com/lagerstrom/gopher-celery/examples

go 1.21

replace github.com/marselester/gopher-celery => ../
replace github.com/lagerstrom/gopher-celery => ../

require (
github.com/go-kit/log v0.2.1
Expand All @@ -11,7 +11,7 @@ require (
github.com/oklog/run v1.1.0
github.com/prometheus/client_golang v1.20.5
github.com/redis/go-redis/v9 v9.7.0
github.com/marselester/gopher-celery v0.0.0-00010101000000-000000000000
github.com/lagerstrom/gopher-celery v0.0.0-00010101000000-000000000000
)

require (
Expand Down
4 changes: 2 additions & 2 deletions examples/rabbitmq/consumer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"os/signal"

"github.com/go-kit/log"
celery "github.com/marselester/gopher-celery"
celeryrabbitmq "github.com/marselester/gopher-celery/rabbitmq"
celery "github.com/lagerstrom/gopher-celery"
celeryrabbitmq "github.com/lagerstrom/gopher-celery/rabbitmq"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions examples/rabbitmq/producer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"os"

"github.com/go-kit/log"
celery "github.com/marselester/gopher-celery"
celeryrabbitmq "github.com/marselester/gopher-celery/rabbitmq"
celery "github.com/lagerstrom/gopher-celery"
celeryrabbitmq "github.com/lagerstrom/gopher-celery/rabbitmq"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion examples/redis/consumer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"os/signal"

"github.com/go-kit/log"
celery "github.com/marselester/gopher-celery"
celery "github.com/lagerstrom/gopher-celery"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions examples/redis/goredis/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

"github.com/go-kit/log"
"github.com/go-kit/log/level"
celery "github.com/marselester/gopher-celery"
celeryredis "github.com/marselester/gopher-celery/goredis"
celery "github.com/lagerstrom/gopher-celery"
celeryredis "github.com/lagerstrom/gopher-celery/goredis"
"github.com/redis/go-redis/v9"
)

Expand Down
2 changes: 1 addition & 1 deletion examples/redis/metrics/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"time"

"github.com/go-kit/log"
celery "github.com/marselester/gopher-celery"
celery "github.com/lagerstrom/gopher-celery"
"github.com/oklog/run"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
Expand Down
2 changes: 1 addition & 1 deletion examples/redis/producer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"

"github.com/go-kit/log"
celery "github.com/marselester/gopher-celery"
celery "github.com/lagerstrom/gopher-celery"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions examples/redis/redis/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/gomodule/redigo/redis"
celery "github.com/marselester/gopher-celery"
celeryredis "github.com/marselester/gopher-celery/redis"
celery "github.com/lagerstrom/gopher-celery"
celeryredis "github.com/lagerstrom/gopher-celery/redis"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion examples/redis/retry/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

"github.com/go-kit/log"
"github.com/marselester/backoff"
celery "github.com/marselester/gopher-celery"
celery "github.com/lagerstrom/gopher-celery"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/marselester/gopher-celery
module github.com/lagerstrom/gopher-celery

go 1.19

Expand Down
2 changes: 1 addition & 1 deletion goredis/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/redis/go-redis/v9"

"github.com/marselester/gopher-celery/internal/broker"
"github.com/lagerstrom/gopher-celery/internal/broker"
)

// DefaultReceiveTimeout defines how many seconds the broker's Receive command
Expand Down
2 changes: 1 addition & 1 deletion rabbitmq/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

amqp "github.com/rabbitmq/amqp091-go"

"github.com/marselester/gopher-celery/internal/broker"
"github.com/lagerstrom/gopher-celery/internal/broker"
)

// DefaultAmqpUri defines the default AMQP URI which is used to connect to RabbitMQ.
Expand Down
2 changes: 1 addition & 1 deletion redis/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/gomodule/redigo/redis"

"github.com/marselester/gopher-celery/internal/broker"
"github.com/lagerstrom/gopher-celery/internal/broker"
)

// DefaultReceiveTimeout defines how many seconds the broker's Receive command
Expand Down