Skip to content

How to ensure IJobChangeListener completion? #1301

Answered by fedejeanne
basilevs asked this question in Q&A
Discussion options

You must be logged in to vote

@laeubi thank you for the snippet!

I agree with @laeubi here: it seems to me that adding a method to wait for listeners is a bad idea and only meant to compensate for bad practices in the user code.

I can of course understand that RCPTT needs that because it should work even with (sorry for being blunt) poorly programmed client code, but I don't think providing such a method as part of the API is a good idea because it encourages bad practices.

My naive approach would be to:

  1. Emphasize (in the documentation) that listeners are not to be misused as "continuation work" and that joining the job does not wait for its listeners.
  2. Promote better practices for client code (like the snippet above)…

Replies: 5 comments 31 replies

Comment options

You must be logged in to vote
1 reply
@basilevs
Comment options

Comment options

You must be logged in to vote
7 replies
@basilevs
Comment options

@laeubi
Comment options

@basilevs
Comment options

@laeubi
Comment options

@basilevs
Comment options

Comment options

You must be logged in to vote
3 replies
@laeubi
Comment options

@basilevs
Comment options

@basilevs
Comment options

Comment options

You must be logged in to vote
13 replies
@fedejeanne
Comment options

@laeubi
Comment options

@laeubi
Comment options

@fedejeanne
Comment options

Answer selected by basilevs
Comment options

You must be logged in to vote
7 replies
@basilevs
Comment options

@basilevs
Comment options

@fedejeanne
Comment options

@basilevs
Comment options

@laeubi
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants