GearmanBundle icon indicating copy to clipboard operation
GearmanBundle copied to clipboard

Added emission of kernel events for GearmanJob lifecycle

Open Eloar opened this issue 7 years ago • 5 comments

  • added GearmanJobWrapper to support GearmanJob event emission
  • documentation enhanced

Eloar avatar Jan 19 '18 22:01 Eloar

Is there an issue number or link to discussion anywhere prompting this PR? Curious about background/context.

bmeynell avatar Jan 20 '18 20:01 bmeynell

Hmm, I think there is none. I made this change so I could easier follow lifecycle of each job passed to worker. Based on that I could make listener storing progress of each task to MongoDB for any client to follow. Second use was to clear EntityManager before each job was started.

Eloar avatar Jan 31 '18 07:01 Eloar

@Eloar - I see you included some documentation in your PR. Could you leverage that to create a GH issue and then associate this PR to that issue? My knee-jerk reaction was that we already have events that can be subscribed to so how is this PR different than what we currently have?

In general having an associated GH issue + PR that references it (instead of a single PR), as a rule of thumb, makes new users easier follow the progression of how changes came to be over time as well as overall context for the change. @daum - agree?

If cannot do, maybe I can squeeze in some time to create a GH based on the docs you provided.

bmeynell avatar Jan 31 '18 15:01 bmeynell

Yeah it would help to understand a bit more via an issue and why the existing kernel events didn't work in your case.

daum avatar Jan 31 '18 19:01 daum

I looked through issues list and my PR relates to #99. I'm using backgrounds jobs for all my workers. Async clients gets no information about job lifecycle (kind of obvious but poorly documented by Gearman itself). With my change I was able to emit events worker side and notify client different way in listeners.

Eloar avatar Feb 09 '18 10:02 Eloar