Comments (2)
We probably don't want to just call sys.exit()
instead of os._exit()
since it may have undesired side-effects (some exit handlers would be called multiple times: when the fork exits, and when TaskTiger exits).
In Python 2.7 we could:
- Store all the
atexit._exithandlers
before we fork (e.g. the length of the array – we just need to know which ones not to execute) - Explicitly execute any
atexit._exithandlers
that were added while the task was executing - Exit the task process with
os._exit()
the same way we do now.
There's also sys.exitfunc
but we shouldn't support it because it was deprecated since version 2.4.
In Python 3.x we can't do that because atexit()
is a built-in module (http://bugs.python.org/issue1680961). We could do the following in Python 3.x:
- After forking,
from atexit import _clear
and_clear()
- Before exiting the task,
from atexit import _run_exitfuncs
and_run_exitfuncs()
. Or, just callsys.exit()
assuming there are no other side-effects.
from tasktiger.
Related to #34
from tasktiger.
Related Issues (20)
- is there any plan to support the Windows platform ? HOT 4
- Class-based task definitions HOT 2
- Normalize task args & kwargs for uniqueness/locking
- Add CLI commands HOT 3
- Redis migration script
- Add endpoint that identifies queues with tasks but not in config
- Proposing a PR to fix a few small typos HOT 1
- queue a task from a PHP script? HOT 1
- Fix hard_timeout in parent process when stored on task function
- Attempt to modify a readonly table script HOT 3
- Task submission by string?
- Add Type Checking HOT 1
- Allow limiting the number of task executions kept in Redis HOT 1
- Refactor keys to avoid duplicate string literals
- Support Redis >= 6.2.7 (Lua readonly global tables) HOT 3
- TaskTiger add support for fork-less model
- Only error tasks if the failure is within the task implementation HOT 4
- Make `func.delay` typed when decorating `func` with `@tiger.task`
- Asynchronous Redis HOT 2
- Inconsistent behavior in periodic function HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tasktiger.