there is a "poor man's interprocess messaging" technique, that works without workers or preemptive processes.
on your form, you have objects. the data source can be form local (a.k.a.) variables. you get pointers to the objects (OBJECT Get pointer). you pass those objects to New process. the new process should be cooperative. you might want to update the UI to indicate that the action was recognised (disable button, etc) in the new process, you read/write the dereferenced pointer, and call (post outside call) -1 to update the UI every n iterations (or seconds). one of the pointers could be a flag that tells the process to abort. on completion, you call the process. (post outside call). of course, if you have access to CALL FORM, you can use it instead of calling the process. preemptive processes are great, but you shouldn't dismiss the advantage of cooperative processes, especially if the task is tied to the user interface. the ability to dereference a pointer that belongs to a different process, as described above, is one of them. (besides, preemptive mode is not available in 4D client) the benefit preemptive process is that they are totally independent. but that can be a curse, if you want some level of synchronisation. for example, if you want to live update the UI, you can't just CALL FORM in a loop. the worker code must be written in a recursive way, so that you give 4D a chance to process the message queue. the code is much simple, if you use a new process in cooperative mode. because the scheduler coordinates the time slice between processes, and you just have to call process (-1) once in a while to update the UI. > 2018/08/29 10:22、Jim Crate via 4D_Tech <[email protected]>のメール: > > I am looking into using CALL WORKER / CALL FORM for an interface where > certain actions will query a service, which could take up to a few seconds. > Using CALL WORKER and CALL FORM would allow me to split the long-running part > to the worker without having to roll my own IP messaging and the On Outside > Call misery. ********************************************************************** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:[email protected] **********************************************************************

