Commit Graph
9 Commits
Author SHA1 Message Date
mvdbeek 34eb9468d4 Use ApplicationStack for accessing server name 2019-03-29 21:46:18 +01:00
mvdbeek f4d5ae61f6 Make tests use finalizer instead of yield
and verify tasks get executed the expected number of times.
Since the part after the yield statement runs to early it
was shutting down the app(s) prematurely.
2019-03-29 21:46:18 +01:00
mvdbeek e778c50453 Also test against rabbitmq 2019-03-29 21:46:18 +01:00
mvdbeek 006f42ddd6 Delete remaining messages on startup
So far I don't think we have any messages that should survive
restarts. If we do at some point we should route them differently
(or change the existing worker to use ephemeral messages).
2019-03-29 21:46:18 +01:00
mvdbeek 038db80258 Add test using multiple independent apps
Unfortunately adding a third app doesn't seem to work.
In that case only the last 2 apps receive the control task.

I do know that this isn't a problem with real separate processes,
but I don't know what is causing this.
2019-03-29 21:46:18 +01:00
mvdbeek 75279121a4 Add option to return worker results
Occasionally we want to wait for a toolbox or data table
reload before continuing, so knowing when that's done
(=wait for the result) is helpful.

Getting the result of a task seems like a good idea,
we could use this for a whole lot of things.
One thing is targeting functions to (remote) handlers
that have access to information that web handlers don't,
like how busy a cluster is or which dependencies are
available or whether a handler is dead.
2019-03-29 21:46:18 +01:00
mvdbeek c8392299c8 Make processes and mules report heartbeat in database
It's important to not set the DatabaseHeartbeat `server_name` prior to forking,
which we avoid be getting `server_name` from
`application_stack.app.config.server_name`.
`WorkerProcess.server_name` for uwsgi web processes will look like:
`main.web.1` and mules like `main.job-handlers.1` while webless workers
remain named `handler1`.
2019-03-29 21:46:18 +01:00
mvdbeek 631a9fc359 Also test with postgresql fixture 2019-03-29 21:46:18 +01:00
mvdbeek 950bb4666f Add simple test for queue worker 2019-03-29 21:46:18 +01:00