Imagine The Company’s report worker has accepted a request for April’s totals. It hasn’t started the report. Fine. Pending is a useful state. It means I can interrupt the worker without having to interrupt April.
The request is a small file in the worker’s runtime directory. Its only copy. I have nevertheless described this queue as persistent, because the files were still there every time I looked. An impressive run of observations, all made while the service was running.
I liked the directory. The service manager created it for us and removed it when the service stopped. No abandoned pid files, no archaeological layers of temporary rubbish. Somewhere to put things without eventually having to decide what they were.
I have a drawer like that. It contains three display adapters and a key to something that was decommissioned before the adapters were manufactured. If the drawer tidied itself whenever I left the room, I would consider that progress. I would also stop putting my passport in it.
Back to April. One accepted request, still pending. I stop the service normally, then start it again, expecting the worker to pick up where it left off.
Fresh runtime directory. No request. No report either.
I read the removal setting. Then I read the queue’s persistence requirement. Then I check that they refer to the same path, which is the sort of checking you do when you would prefer two correct sentences to be somebody else’s problem.
The service manager has kept its promise. I gave the application a different one.
For a moment I consider leaving the worker running forever. No more normal stops.
April’s report can wait indefinitely. Preserving its place in the queue requires a service that must never stop, even while it isn’t doing the report.