mirror of
https://github.com/hibiken/asynq.git
synced 2026-04-25 23:15:51 +03:00
[GH-ISSUE #77] Other serialization format #1033
Labels
No labels
CLI
bug
designing
documentation
duplicate
enhancement
good first issue
good first issue
help wanted
idea
invalid
investigate
needs-more-info
performance
pr-welcome
pull-request
question
wontfix
work in progress
work in progress
work-around-available
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/asynq#1033
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @hibiken on GitHub (Feb 9, 2020).
Original GitHub issue: https://github.com/hibiken/asynq/issues/77
Originally assigned to: @hibiken on GitHub.
Experiment with other serialization format and benchmark performance and memory usage:
Other serialization format:
@cielu commented on GitHub (Feb 11, 2020):
Hello, hibiken , how to use this lib in go-gin ?
@cielu commented on GitHub (Feb 11, 2020):
Why I can't kill the process ?
@hibiken commented on GitHub (Feb 11, 2020):
@cielu Which OS are you using?
If you are on Windows, maybe something related to https://golang.org/pkg/os/signal/#hdr-Windows.
Please take a look at the Signal Wiki page on how to gracefully shutdown the background workers.
@cielu commented on GitHub (Feb 11, 2020):
@hibiken macOS, But I start the worker in go-gin . Do you have any good idea ? thanks ..
I'm new at go
@hibiken commented on GitHub (Feb 11, 2020):
So you are using github.com/gin-gonic/gin for your web framework, correct?
And are you starting the workers (
bg.Run(handler)) from your web server's main?@cielu commented on GitHub (Feb 11, 2020):
@hibiken Yes , that's right . Here is my main func code
@hibiken commented on GitHub (Feb 11, 2020):
I see.
The intended use case of
asynqis that you useClientto schedule tasks to be processed in the background outside of a user request, and have another process(main.go) to process those tasks in the background.So you will create another
main.goapart from your web server.So for example, you will have something like this in your web server's main file:
and create a separate
main.gofile for workers:@cielu commented on GitHub (Feb 11, 2020):
Yeah . enhh, I got you . But , can i start the worker in one project ? I don't want separate it .That is a lot of trouble
thanks 😊
@hibiken commented on GitHub (Feb 11, 2020):
I see.
Background.Runmethod will block and wait for a termination signal (OS signal TERM or INTERRUPT).I think if you want to start the workers from your web server's main then try this:
If that doesn't work, then another option is to fork this repo and export
Background.StartandBackground.Stopmethods (currently they are unexported) and call those to start and stop the background workers, those methods are non-blocking.@cielu commented on GitHub (Feb 11, 2020):
Ohh. Thank you very much !
@hibiken commented on GitHub (Feb 22, 2020):
Closing this issue for now