/* worker.du -- Individual bee worker process Each spawned bee increments the shared swarm counter multiple times before exiting. Uses context() to get the request/spawn data. */ ctx = context() bee_id = ctx.bee_id // Get the swarm datastore swarm = datastore("swarm") swarm.increment("bees") // This bee does some work for i = 1, 5 do swarm.increment("buzzes") sleep(0.1) end // Exit and signal completion exit({status = "done", bee_id = bee_id})