Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Will the function call
Things["MyDataStream"].AddStreamEntry(params);
wait until all data has been added to the stream before returning back to the script which called it?
In other words, if I need to make that function call repeatedly, let's say in a for loop, do I somehow have to manage the timing of everything so that all data will be added to the stream before I call the function again?
Please advise.
Thanks
Loren
Hi Loren, not sure if you remember. But Streams are asynchronous. So you can call the Add stream function as many times as you want and they will just be handled. But if you need to immediately use the information from the stream, you have to be careful with timing issues.
Hi Pai,
Thanks for the quick reply.
I seem to be having issues where data is not getting into the stream as I expect. Sometimes it works and sometimes it doesn't. The first few calls to AddStreamEntry seem to always work but the calls that occur in the later iterations of the loop seem to have issues. Running the service on different ThingWorx machines also gives me different results. Also, the more entries the Stream has the more issues I seem to have.
Any ideas for debugging?
Hi Loren, I recommend you open up a case with technical support.