# Implementing as Generic Job Scheduler

**URL:** <https://discuss.hangfire.io/t/implementing-as-generic-job-scheduler/7813>\
**Category:** question\
**Created:** [September 24, 2020, 8:33pm UTC](https://discuss.hangfire.io/t/implementing-as-generic-job-scheduler/7813 "2020-09-24T20:33:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Archvist](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/archvist/32/1991_2.png) [@Archvist](https://discuss.hangfire.io/u/Archvist)\
**Post date:** [September 24, 2020, 8:33pm UTC](https://discuss.hangfire.io/t/implementing-as-generic-job-scheduler/7813/1 "2020-09-24T20:33:28Z")

</div>

For those of you that use Hangfire to build a “generic” job scheduling solution, how do you architect the “jobs” it runs?

Examples:

1. jobs are classes defined in the hangfire server you’ve built; you enqueue those classes;
2. jobs are scripts (powershell or something) that hangfire executes;
3. jobs are API calls to rest services, code for the actual “job” are elsewhere;

---

<div class="post-metadata">

**Author:** ![oneillci](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/oneillci/32/2092_2.png) [@oneillci](https://discuss.hangfire.io/u/oneillci)\
**Post date:** [October 1, 2020, 11:55am UTC](https://discuss.hangfire.io/t/implementing-as-generic-job-scheduler/7813/2 "2020-10-01T11:55:12Z")

</div>

Yes, we do this. Jobs are classes that implement an interface with a Run method. Jobs just take an id as a parameter and 1st thing job does is load the real parameters from our own job table via the job id passed in.

Hangfire invokes the method on the required schedule via reflection - you can see your assembly qualified class names and serialised parameters in the hangfire tables.

It all works really well and really consistently

---

<div class="post-metadata">

**Author:** ![Archvist](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/archvist/32/1991_2.png) [@Archvist](https://discuss.hangfire.io/u/Archvist)\
**Post date:** [October 1, 2020, 3:15pm UTC](https://discuss.hangfire.io/t/implementing-as-generic-job-scheduler/7813/3 "2020-10-01T15:15:14Z")

</div>

Thanks oneillci.

How does the Hangfire server application gain access to these classes. Are they compiled in the same project (so every time you have a new job you need to redeploy the entire application). Something else?

---

<div class="post-metadata">

**Author:** ![shahhd](https://avatars.discourse-cdn.com/v4/letter/s/f475e1/32.png) [@shahhd](https://discuss.hangfire.io/u/shahhd)\
**Post date:** [November 19, 2020, 3:40am UTC](https://discuss.hangfire.io/t/implementing-as-generic-job-scheduler/7813/4 "2020-11-19T03:40:33Z")

</div>

I also had the same question. Any thought Archivist ? What is the final verdict?

---

<div class="post-metadata">

**Author:** ![Archvist](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/archvist/32/1991_2.png) [@Archvist](https://discuss.hangfire.io/u/Archvist)\
**Post date:** [November 19, 2020, 2:56pm UTC](https://discuss.hangfire.io/t/implementing-as-generic-job-scheduler/7813/5 "2020-11-19T14:56:45Z")

</div>

No verdict so far. My guess is that we’ll have to either put the DLL’s in the GAC (general assembly) or load them dynamically somehow!
