cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

AddStreamEntry function call timing

lorenmc
1-Newbie

AddStreamEntry function call timing

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



3 REPLIES 3
paic
1-Newbie
(To:lorenmc)

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.

lorenmc
1-Newbie
(To:paic)

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?



paic
1-Newbie
(To:lorenmc)

Hi Loren, I recommend you open up a case with technical support.

Top Tags