Answer the question
In order to leave comments, you need to log in
Are there examples of a go project structure with workers?
It is necessary to implement several workers for one go project. How do you usually structure such a project?
At the moment, the structure is something like this:
config
--config.go
utils
--error_handler.go
--init.go
models
--users
--posts
worker1.go
worker2.go
As you can see, to run a specific worker, I run them through go run { worker name}.
However, I have certain doubts about the correctness of this action, I would like to know how they usually do in such situations.
Answer the question
In order to leave comments, you need to log in
It makes sense to compile the CLI application and run the binary with the necessary parameters, like this
yourprog worker1
yourprog worker2
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question