On Sun, May 7, 2017 at 3:07 PM, Keisuke Miyako via 4D_Tech < 4d_tech@lists.4d.com> wrote:
> first up, I myself am still in the process of learning how workers work, > and I totally agree one should probably start with small POCs or > relatively minor tasks before going full on. > I think many of us here will be very interested in how you end up using workers, so please share when you find applications that you like! > keep in mind a CALL WORKER can create a new worker if the previous one was > killed. > for instance. imagine a recursive worker method, using process variables > for context, > aborted for whatever reason from the debugger or runtime explorer. > the worker is killed, but a new "call" comes in from the previous context, > starting a new worker that has no idea where the previous worker left off. > that can be a nightmare. > Yes, exactly! There is no On Worker Start or On Worker Stop event - so it's *very* important that they not be terminated accidentally. For what it's worth, I've been working with workers, call message, and call form intensively for a few months and am pretty deep into the details of the mechanics. I like the commands and I think 4D did an admirable job of providing power without complexity. I never would have come up with the design they did as there are a lot of standard queuing features I would never have considered dropping the way they did. I've tried to be open minded about their design choices. But the more I get into it, the more I'm seeing how different designs wouldn't be much more complex (if any more complex) without taking away any of the power. As far as preemptive mode goes, I think that CALL WORKER and preemptive processing are wedded in people's minds because that's how 4D has been presenting the subjects. I guess that they added workers to solve the problem of dropping IP variables for IP communication. I didn't use IP variables that way (too hard and expensive to use safely, too dangerous and messy to use any other way)...I just use them for pseudo-constants/cached items. So, CALL WORKER didn't solve a problem I had...but I love message queues and have been trying to convert CALL WORKER into an actual message queue system. (Callbacks and Publish/Subscribe.) keep in mind a client process can never be preemptive. > Yes, I've noticed that. I don't know what the reasoning is there or if it will change. It's just server-side processes, in compiled mode, using legal commands, on a multi-core machine, where you've launched the process in preemptive mode. Whew! Or stand-alone... ********************************************************************** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **********************************************************************