On Sun, Oct 21, 2018 at 6:29 AM Keisuke Miyako via 4D_Tech <
4d_tech@lists.4d.com> wrote:
>
> the best way to share an object or collection between processes is to
pass a shared object or shared collection as a parameter.
> there is no need to use Storage, there is no need to use interprocess
variables.
> you just create a shared object or shared collection, and pass it as an
argument to another process or worker.
> the received object is not a copy, it is a shared reference to the same
shared object.
>

Keisuke,

is there a way how to convert non-shared collection to shared? Some
commands return normal collection, like
selection.toCollection("ID") or collection:=selection.ID
and I want to pass the collection to other process without duplication, but
have not found a way how to convert normal selection to shared one.

Tried
collection:=New shared collection
collection:=selection.ID
but it seems collection was reverted to normal one. When I tried

Use (Storage)
  Storage.collection:=New shared collection
  Storage.collection:=$settings.ID
End use

I got a runtime error. Even

Use (Storage)
  Storage.collection:=New shared collection
  Storage.collection:=$collection.copy()
End use

is not possible, although this is what I want to avoid.

Best would be to have shared entity selection - like interprocess named
selections - which would then generate shared collections.

--

Peter Bozek
**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to