saurabhnanda / odd-jobs

Haskell job queue with admin UI and loads of other features.
https://www.haskelltutorials.com/odd-jobs/
BSD 3-Clause "New" or "Revised" License
75 stars 29 forks source link

Allow jobs to have return values, which get persisted in the DB #103

Open saurabhnanda opened 1 year ago

saurabhnanda commented 1 year ago

@jappeace @ivb-supercede any thoughts on this functionality / feature? Few notes:

jappeace commented 1 year ago

Yes this maybe usefull for quick n' dirty jobs where you don't want to make a dedicated table for the job to writeout in.

Good to see you back :)

jappeace commented 1 year ago

I left supercede, @RiugaBachi may also wish to comment.

saurabhnanda commented 1 year ago

Folks, this has a breaking change in the library's external API. Is everyone largely fine with this?

@jappeace @tfausak @tchoutri

(please tag other active users, as well)

tchoutri commented 1 year ago

No objection on my part

jappeace commented 1 year ago

Is there a way you could implement this without breaking existing code?

tfausak commented 1 year ago

I see why this is useful. My team wouldn't necessarily benefit from it, so I could take or leave this change.

Any change to the schema of the job table is unfortunate. However adding a new optional column is about as low impact as you can get.

I would appreciate a non-breaking release before any breaking change. We've been using a source-repository-package (rather than a Hackage release) for a while now.

saurabhnanda commented 1 year ago

@jappeace @tfausak one way to not break any existing code would be to have a build-time flag along with liberal use of CPP at the following places:

is there any other way to do this? and if CPP is the only way, when do we get finally get rid of the CPP?

jappeace commented 1 year ago

I was thinking along the lines of: instead of changing this function in place, we add a new one and see if it can be made compatable, however I'm not sure if it's possible.

I'd not go the CPP/flag route as that incurs a rather troublsome maintenance burden and rather do the breakage.

saurabhnanda commented 1 year ago

I was thinking along the lines of: instead of changing this function in place, we add a new one and see if it can be made compatable,

@jappeace I think two versions of functions can still be dealt with, but what do you think about the Job{..} data type?

Does anyone use the Job{..} constructor in their application code? For creating a job if everyone is using the createJob function, then adding optional/nullable fields to Job{..} should not be. a problem...

saurabhnanda commented 1 year ago

I think the two DB columns that all users of the library are going to be forced to create are a greater problem than the Haskell code.... any ideas on how to tackle this?

saurabhnanda commented 12 months ago

@tchoutri @jappeace @tfausak what do you feel about the current attempt on making this backward compatibly and purely opt-in?