-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[doc] Feature request: Maybe slightly enhance the concurrency documentation? #99
Comments
More documentation can't really hurt. The current state somewhat convers all the features but doesn't give a guideline on how to reach certain things. Exactly like you explained. I am all in if you have concrete ideas/examples. If you want, you can easily play around with the documentation without any setup. We have devcontainer support and predefined tasks for serving the docs. |
Yeah, I've been there, not with NCronJob specifically, but with similar concurrency challenges like deadlocks and race conditions that would take down a production app. I'd be happy to help with this. @nulltoken, could you provide more details about your use case for 'Recovering from a server crash that could happen mid-process'? Currently, NCronJob doesn’t include built-in crash recovery strategies, but I’d be open to discussing how we might handle this. Are you thinking of something like a checkpointing system or idempotent job design to ensure safe restarts after a failure? |
@falvarez1 Sorry for the late response. My question wasn't a hidden way to request for a feature. To be honest, I'm pretty happy with the lib as it is. It ticks many checkboxes on my list.
From very far, it could be seen as an alternative to Azure Durable functions. However, as a job lives in memory and has got no idea how many of its siblings run at the same time, some design has to be done to make this work. Hence my initial request. Regarding how I use it, although NCronJob has been on my watchlist for some time, I only started to use it in September when a simple enough project popped up where it could be battle tested.
As I mentioned earlier, this is pretty basic and a good testbed for NCronJob. As such, the design was pretty straightforward:
So, in brief:
The overall total of lines to make this work (of course not counting the "validation" code in each job) is less than 150 lines of code. (And sorry for the wall of text...) |
Just a random thought. Concurrency may happen when running multiple times the same job on one instance. It may also happen would the host application be deployed in a web farm.
Designing this sort of jobs properly may require some
experienceprior painful production burn scars.I wonder if an example (or a high level pseudo code) may help the reader understand what should be to be taken care of.
For instance, given a process feeding a database with things to process in a state
A
, how to safely design a job that could process those things and bring them to a stateB
in a conccurently-aware way:The text was updated successfully, but these errors were encountered: