Bober02
Bober02

Reputation: 15351

Listeners - inform about finished event stream

I have a number of listeners that are registered with the main event generation service. I would like, however, to inform the listeners, that at some point the event stream would have finished. Would you do it via simply calling a method on a listener, say finish() or would you have a separate event method streamFinished(EmptyEvent e)?

Upvotes: 0

Views: 140

Answers (1)

Stephen C
Stephen C

Reputation: 719346

I think that the answer depends on things that you haven't mentioned, such as whether there are already different kinds of event and different kinds of event listener.

But it probably doesn't really matter which way you do it.

My advice would be to pick the approach that seems most right to you ... or just toss a coin if you cannot decide. Don't over-think the problem. (If you get it wrong, you can always revisit your decision ... provided your APIs haven't been baked into other peoples' code.)

Upvotes: 1

Related Questions