Now the issue is that this is acutally a long running job (I am using WebMapTiler to create about 5K - 25K PNG map tiles). It can take up to 10 minutes to run.
I would like to provide status messages to the spawning .NET program (let's caller it spawner.exe) and the workspace that it spawns MakeTiles.fmw. I am using FME Desktop 2013 (Budget will not handle FME server, since we would need hundreds of engines. Besides it is overkill for what the sponsor wants).
I want messages of the format: "Created 456 of 5,674 tiles" "Estimated completion in 5.32 minutes"
I can think of three methods, but I need more information on how to do this (or which one is the best).
1. Polling the log file
I can have spawner.exe do a 2-5 (sec.) repeating read/parse of the FME log file. I see the log does provide a hard number for how many tiles it is going to create, and it it should be possible to scan the text for how many are done.
PROS: It probably will work, and I don't need to learn anything
CONS: Kludgy
fragile (any change to the syntax of log messages will kill it
high overhead (parsing, greping, etc. of the log text
I hope I can open for read while this is being written.
I have to do a sum of the counts of the lines written
2. HTTPFetcher
My Spawener.exe is actually a stand-alone WCF data server. So it is easy to open up a localhost port (e.g 4326) and get messages from the HTTPFetcher transform that would have arguments telling me what the current tile count and total tile count are. I like this idea the best, but I have no idea how to get this info out of the WebMapTiler or anything downstream of it (Expression Evaluator, StringConcatantor, or PNGRaster writer).
PROS: clean, simple, robust
CONS: Need information on how to implement
3. Polling a file
If I can get the current tile & total tiles to output - from the WebMapTiler, then I could conceivably write a file (and keep re-writing it) with the text "Created 456 of 5,674 tiles". I can do the time estimates from that. But I have no idea how to write such a text file, nor how to get the informaiton for this file. Nor how to keep re-writing it.
PROS: pretty clean, and robust
CONS: Still requires a poll read-file loop from the server
Lots of open issues
Any ideas for me. Something I left out?