Quoting dhurandar S (2020-03-16 18:13:32)
> I have the following scenarios.
> I have agent/sensor which runs on individual laptops and machines
> across geographies and timezones and every so often wakes up and asks
> for some work from the central master hosted in the cloud (AWS) . If
> Master has some work it assigns the work to the agent and the agent
> simply executes the work.
> These agents communicate with the central master via HTTPS while asking
> for more work, and while sending the status of the work its doing,
> that's also the mechanism to provide heartbeat.
> Please remember these workers are always up and keep asking for new and
> new work from the master in the cloud to execute.
> Clients typically submit work to Master on a regular basis , they have
> 2 modes, do the work only once when it's submitted, do the work in an
> ongoing fashion at regular intervals.
Gearman may in fact be useful here. However, it may be a bit lower level
than you are expecting, and you may need to add some utility workers to
achieve your goals.
For the workers that sleep and wake and grab work, that's exactly how
Gearman works. So your workers will connect to all of the gearman
servers and tell them the functions they can do, and then as clients
submit jobs, the workers will be woken up to do the jobs.
This is all handled quite nicely in most client libraries by simply
building a worker object, adding the servers and function callbacks, and
then entering a wait loop.
For doing immediate work, this is very simple on the client side, and
you only need to decide whether you want clients to wait for the job to
be completed, or submit them as background jobs. I highly recommend the
former, as background jobs are either volatile (gearmand dies, they do
too) or expensive (gearmand can store them in a reliable place like
MySQL or Postgres).
As far as ongoing periodic jobs, you'll need something to submit those,
such as a cron job, or a resident daemon that submits them.
> Can I use java based Gearman in this scenario? If gearman is not a good
> fit here , can anyone recommend another system i can use ??
To be clear, there's a java gearman server, which I have heard only good
things about, but haven't used. And there's java gearman client
libraries. Either are fine in your scenario, with the caveat that you
will have to do some thinking about background versus foreground, and
you'll have to implement periodic job submission yourself.
> You received this message because you are subscribed to the Google
> Groups "Gearman" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to gearman+u...@googlegroups.com
> To view this discussion on the web visit
> 1. mailto:gearman+u...@googlegroups.com
> 2. https://groups.google.com/d/msgid/gearman/df290266-0029-4b0d...@googlegroups.com?utm_medium=email&utm_source=footer