You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Enqueue task to be executed by next available worker.
Maybe you have some examples, how I can pass db connection to worker? Not to specific task.
Main idea is: Up some workers with 1 connection per worker and do sql requests(tasks) using worker sql connection.
The text was updated successfully, but these errors were encountered:
Tri0L
changed the title
Why startWorker() and not worker()
Why startWorker() and not worker()?
Apr 26, 2022
I am interested in doing something similar to this as well. Maybe there needs to be a worker interface that we can use to create our own custom workers that will then be started and stopped by the pool.
When starting a new worker, that new worker to run the new task directly, instead of pulling it off the work queue. Since the behavior was slightly different when starting, I split it into two functions. Other than that, there is no reason it cannot be the same function. That change to use the same function and goroutine was made in #59.
Hello!
Why are you using
startWorker()
and notworker()
?workerpool/workerpool.go
Lines 192 to 200 in 85cc841
Maybe you have some examples, how I can pass db connection to worker? Not to specific task.
Main idea is: Up some workers with 1 connection per worker and do sql requests(tasks) using worker sql connection.
The text was updated successfully, but these errors were encountered: