IP sets and named selections in workers: What should we expect?

I just raised this question on the 4D NUG and then remembered it’s the wrong place for that. Apologies for cross-posting.

I also forgot to mention there that I only tested this with cooperative workers and did test compiled and interpreted. Here’s the question:

Workers don’t allow for IP variables/arrays, but do allow for virtually every other thing that you can have in a normal process. You don’t get IP vars, but you do get CALL WORKER. Fine by me. But then I wondered “what about IP sets?” I guessed that an IP set or named selection created outside of a worker would not be visible within a worker. I was wrong.

I did a five-minute scratch database and tested out:

  • Create an IP set in a standard process (process 1 or a new process, same results).

  • Call a worker and tell it to run a method that uses the set or named selection and report how many records there are.

The worker saw the IP set and IP named selection just fine.

I have no problem with this - I think it’s a good result - but i didn’t find any documentation on the feature one way or the other. Is this something that we can count on, or is it something that might change in future versions? We can pass in sets and selections via data without relying on IP sets/named selections…but I wouldn’t go to the trouble unless I have to.

Good point. It’s not documented, yes. It seems to work, yes.

I honestly never tried, as - for me - workers are supposed to run independent and not using shared objects.
If I want to ask a worker to work with a set/selection, I pass a longint/boolean array as parameter.
But that’s just my prefered way of working, no general rule.

I’ll check if that’s feature (-> add it to documentation) or a bug (-> report it).

Thanks for getting back to me on this. I agree with your sentiments and am not sure that I will ever use IP sets and named selections. Still, it would be helpful to know…I’m making a diagram :wink: