Skip to content
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

Bree applied to data ingest #217

Open
jvanek opened this issue Apr 24, 2023 · 1 comment
Open

Bree applied to data ingest #217

jvanek opened this issue Apr 24, 2023 · 1 comment

Comments

@jvanek
Copy link

jvanek commented Apr 24, 2023

Hi all,

We have a quite complex platform to ingest sports data. We need to find (or develop) a tool which would be able to:

  • start a long running task (1-2 hours) programmatically, the start comes from another part of our platform
  • ensure periodically (every 2 min) that this task is still correctly running
  • ensure after a given time this same task is not stuck or running indefinitely (let's say after 3-4 hours)
  • know if/when the task is finished
  • be able to kill the task if it goes in infinite loop

There is in fact only one and same task for every launch, only the parameters change,
so I don't need to have multiple jobs defined in jobs directory as I have seen but there can be several
tasks launched at the same time.

I feel Bree could do the job very well, but I haven't seen any example how a job could be launched
programmatically; all samples show job definitions at start and then the framework is left in async
mode until all is done.

Would you mind to give me some very short example how I could achieve my constraints mentioned
above please ? Or if I can do what I need with Bree framework ? Maybe there is a simpler solution ...

Thanks
Josef

@YeomansIII
Copy link

Hi @jvanek. Please take a look at the types file where you can find all functions, options, and interfaces available in the library. https://github.com/breejs/bree/blob/master/types/index.d.ts

Specifically, you can use bree.add(myJob); to add a job to an existing Bree instance. Once a job is added, it will need to be started in order for it to run based on your schedule.

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants