[Bug 15032] [Plack] Scripts that fork (like stage-marc-import.pl) don't work as expected
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15032 --- Comment #37 from David Cook <dcook@prosentient.com.au> --- (In reply to Tomás Cohen Arazi from comment #36)
I need to implement a way to hook record/item updates so changes are pushed to an external service. Ideally through the use of plugins so a more generic job queue was the first thing to consider. Then if we replace (say) rebuild_zebra.pl -d with this, we should add a way to inject new 'tasks' derived from this events (so a record update should trigger a zebra/ES indexing step, and also look for things (plugins) that would require actions. It felt simpler if it just sent broadcast messages through a socket to any service listening there. I like ZeroMQ because it doesn't need a server, you just use your own service.
So, one event => multiple actions.
I've been wanting a hook for record/item creation/update/deletion as well, so it sounds like our desire is similar there! I'm sure many people have a variety of external services which would like event-driven updates from Koha. I read about ZeroMQ a while ago, but I didn't realize it doesn't need a dedicated broker (ie server). That's interesting! It would be fun to play with that. In the context of #15032, would you still want to use a message queue? I could see Koha sending a message to an importer service (in a pub/sub pattern), but I'm not sure how Koha would know when the import task is finished without having a result store. I suppose we could have a result store though. We could send a message to the importer service, and then asynchronously poll the result store to see when the task is done? I suppose that has disadvantages in that if the task fails, you're polling forever. And if you're polling, you also lose any sort of progress meter (although I always assumed we faked the progress with our current background implementation anyway). I guess those are just implementation details though. (With #10662, the Koha web UI connects to the OAI-PMH harvester demon through a Unix socket. It has bidirectional communication though as it has a request-reply relationship.) -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org