nsoufr / superworker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

concurrency by server x concurrency by worker

nsoufr opened this issue · comments

The current implementation establishes the concept of OneQueuePerWorker. Which create another choice make:

a) Concurrency by server:

$ go run main.go --concurrency 10
  • All worker will share the same amount of resources;

b) Concurrency by Worker

server.AddWorker("create-lead", &LeadCreateWorker, &WorkerOpts:{Concurrency:  10})
server.AddWorker("index-lead", &LeadIndexerWorker, &WorkerOpts:{Concurrency:  5})
  • In the same process the server will spawn 10 goroutines for create-lead and 5 for index-lead;