I'm planning on pulling data from a webservice and push the data on to a buffer/queue for each response. This should happen in a thread, while another thread parses the data (heavy) and writes them to disk. Time is of the essence, so the goal is to run the webservice requests parallel to processing data in the queue.
Do you have any tips on how to "drive" this? Can I put pop/push event handlers on the queue, event handlers on webservice responses or event handlers on complete disk operations? All of the above? Will I need polling to check if the disk operation is done or other types of waiting mechanisms? I don't like polling... What about thread safety and the queue? Some sort of locking technique is required?
Any tips, links to examples etc. will be much appreciated.
Do you have any tips on how to "drive" this? Can I put pop/push event handlers on the queue, event handlers on webservice responses or event handlers on complete disk operations? All of the above? Will I need polling to check if the disk operation is done or other types of waiting mechanisms? I don't like polling... What about thread safety and the queue? Some sort of locking technique is required?
Any tips, links to examples etc. will be much appreciated.
Comment