Comments (5)
We ended up having to roll our own to enable something like this, for a variety of use-cases where this was the right trade off. It was also handy being able to share DB connection pool context for certain types of jobs.
from bree.
In order for it to offload it would probably make since for bree to create a dedicated worker that could then accept a message containing the path to the job and run the job. This way the main thread does not get stuck and therefore no longer processing other scheduled jobs that should be run on a separate event loop.
It probably makes sense to address #45, before trying to do this. If #45 was addressed it might resolve this issue without a specified "offload" option, since the overhead wouldn't be a problem any more.
from bree.
Hey @niftylettuce, @titanism, and @shadowgate15 is inlining jobs still something you'd be happy to have as a part of the package?
One of the usecases for such jobs is being able to have all the environment setup as the parent process has already but use same messaging, scheduling, etc. as the rest of jobs in bree. The implementation I'm thinking of is similar to one Ghost has taken through fastq - I'd aim to mostly port the functionality from Ghost's job manager into bree.
Or do you think non-worker-thread work is not something that belongs to bree?
from bree.
New features and PR's always welcome. We don't use inline jobs because if one crashes then all crash on same process, which is why we did this with worker threads.
from bree.
Awesome, thanks @titanism. Yes, you are spot on with the downside of inline jobs. It's a trade-off a developer would need to decide on when choosing a way to run their jobs 👍
from bree.
Related Issues (20)
- [feat] function to list all runnning jobs HOT 1
- [fix] Error [ERR_UNSUPPORTED_ESM_URL_SCHEME] HOT 3
- [fix] Cron last day of the month incorrect behaviour
- [fix] script works in main thread but fails in worker thread with FATAL ERROR or silent crash HOT 2
- Bree applied to data ingest HOT 1
- [fix] Missing await on 'start' function.
- [feat] Please Allow us to see what jobs are in the Que
- [fix] Types aren't making timeout and interval optional HOT 2
- cron job starts after timeout not after definition HOT 2
- [fix] Bree not working with Later HOT 1
- Bree Workers Won't Follow closeWorkerAfterMs rule
- Using, name + path + cron starts job on start HOT 1
- [fix] cannot extends types HOT 5
- Bree Job not able to resolve the dependencies
- TypeError: Bree is not a constructor HOT 3
- Job sometimes reports as "already running" when it isn't, and then runs anyway
- [fix] Bree doesn't gracefully exit HOT 4
- [feat] Need to be able to remove job after # of runs HOT 5
- [fix] Job using class function throws syntax error when run HOT 1
- [fix] Attempting to access worker data within a function job throws `worker_threads_1 is not defined`
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 bree.