04-18-2020 06:06 PM
Me again trying to learn LVOOP. So I've made good progress. Now I have a UI loop plus some process loops that need to share some of the same data. If I fork the class wires used in these multiple loops, I'm pretty sure that I will make copies made of the data within. Included in one of the classes are some queue and user event refnums used for communicating between the loops. I fear that once I fork the wires, I will "break the links" between the various processes, and the refnums won't work.
Now, forking such refnums is normal, proper practice - that's how we always roll, right?! But can anybody tell me whether those refnums will still work when contained as class data on forked class wires?
Now I just know that at least one of you will try and lead me into that dark dangerous forest called The Dark Dangerous DVR Forest (says that on my map). After 3 weeks of learning OOP, I barely have enough neurons to eat dinner and go to bed. I fear the DVR Forest and the dangers within, to be honest - paul
Solved! Go to Solution.
04-19-2020 06:33 AM
I think you may be overthinking references. Here is an example of a reference:
NI.con user PaulOfElora
And now I'll make some copies of the reference:
NI.con user PaulOfElora
NI.con user PaulOfElora
NI.con user PaulOfElora
Now, why do you think these copies won't "work"?
Queue and User Event references are just the same; they are just a type combined with an identifier, which in their case is just a number rather than a username:
Queue 31645789
User Event 6526890
There's no magic that can get broken, that's all they are. A type and a number. You could turn them to just numbers, pass them to another application over TCP, pass them back again and turn them back to references and they will work (and I have done this as part of message reply routing).
04-19-2020 09:02 AM
Guilty As Charged of Overthinking! Career criminal, honestly. Thank you for clarifying, Dr. Powell - paul
04-20-2020 03:31 AM
@PaulOfElora wrote:
Me again trying to learn LVOOP. So I've made good progress. Now I have a UI loop plus some process loops that need to share some of the same data. If I fork the class wires used in these multiple loops, I'm pretty sure that I will make copies made of the data within. Included in one of the classes are some queue and user event refnums used for communicating between the loops. I fear that once I fork the wires, I will "break the links" between the various processes, and the refnums won't work.
Now, forking such refnums is normal, proper practice - that's how we always roll, right?! But can anybody tell me whether those refnums will still work when contained as class data on forked class wires?
Now I just know that at least one of you will try and lead me into that dark dangerous forest called The Dark Dangerous DVR Forest (says that on my map). After 3 weeks of learning OOP, I barely have enough neurons to eat dinner and go to bed. I fear the DVR Forest and the dangers within, to be honest - paul
Yes, forking the wire will copy the data. If it's a reference it'll work fine as long as it was created beforehand. Any private data apart from references are now unique and their own instance. (Technically so if the reference, it's just that it points to the same place/instance as before) 🙂
04-20-2020 06:24 AM
Thanks Yamaeda, that's what I thought - paul