NCronJob-Dev / NCronJob

A Job Scheduler sitting on top of IHostedService in dotnet.
https://docs.ncronjob.dev/
MIT License
159 stars 11 forks source link

v3 branch #90

Closed linkdotnet closed 2 months ago

linkdotnet commented 4 months ago

This is the ongoing branch for v3.

linkdotnet commented 4 months ago

Fixes #44 Fixes #59

falvarez1 commented 4 months ago

@linkdotnet what do you think about converting Task to ValueTask for IJob.RunAsync? Since this already creates breaking changes to IJob if changing to ValueTask improves performance then it can be included. Of course, I would need to run some benchmarks before making any changes.

linkdotnet commented 4 months ago

@linkdotnet what do you think about converting Task to ValueTask for IJob.RunAsync? Since this already creates breaking changes to IJob if changing to ValueTask improves performance then it can be included. Of course, I would need to run some benchmarks before making any changes.

That is a good idea - I didn't have very much time lately but those smaller things seemed somewhat in reach without investing hours in one session (what one would need for bigger features).

Coming back - ValueTask might be a good choice here as well. Absolutely.

linkdotnet commented 4 months ago

I will create a ticket for that.

One has to figure out how we can "warn" users that are using Minimal API, that are returning Task and don0t get a compiler hint. We might want to transform the Task automatically to a ValueTask. In general that would be dangerous but from our libraries point of view, that should be fine.

Edit: On second thought: Maybe the risk introduced doesn't justify the benefit (if there is at all). Given that Jobs are normally I/O bound and "slow" in nature, using ValueTask might have <0.01% impact in allocations/performance.