I'm currently implementing a service that has remotely callable procedures. This is using datasnap which runs the procedure in a newly spawned (or taken from a pool) thread.
One of these procedures involves some communication with a device using some sdk provided by the device manufacturer and has a few very short verification steps before starting a very long data transfer step.
My objective would be to run all the quick step and if all the checks are ok, return a confirmation to the caller of the remote procedure and then proceed with the time consuming data transfer. Thus avoiding to have the caller wait for confirmation that the transfer has started.
My intuition is that i should be able to do that with a high level construct from omnithread library that could run this whole process and send back a message to the caller thread midway through to signal that all the quick check passed and that the data transfer phase is about to start.
I'm just not sure which high level primitive is right for it. Maybe a Future
?
But it seems like future has been designed to send back results at the END of execution (calculation oriented tasks) and not send messages midway through.
Any idea?