RichardKnop / machinery

Machinery is an asynchronous task queue/job queue based on distributed message passing.
Mozilla Public License 2.0
7.53k stars 915 forks source link

v2 init eager mode #659

Open rosstimothy opened 3 years ago

rosstimothy commented 3 years ago

v1 has the following at the end of NewServer

         // init for eager-mode
    eager, ok := broker.(eager.Mode)
    if ok {
        // we don't have to call worker.Launch in eager mode
        eager.AssignWorker(srv.NewWorker("eager", 0))
    }

v2 seems to be missing the equivalent functionality, requiring the user to set the worker themselves

agvol commented 3 years ago

May be you looking for https://github.com/RichardKnop/machinery/blob/master/v2/example/go-redis/main.go#L86-L87 ?