I like your approach, but I see a couple of minor drawbacks:
In the LifecycleEvent queue, that ERROR is going to be placed after the close command, which is a problem because the contract says that the user can expect nothing more to arrive after the close.
Additionally, If we can avoid overriding emitLifecycleEvent, then I think that would help keep the code cleaner. It wouldn't be unreasonable for a developer to be surprised that the OkHttp client overrides it when the JWS client doesn't.
So I'm going to try something else -- let me know what you think. If my approach ends up having worse drawbacks then we'll revisit this.
I like your approach, but I see a couple of minor drawbacks:
ERROR
is going to be placed after the close command, which is a problem because the contract says that the user can expect nothing more to arrive after the close.emitLifecycleEvent
, then I think that would help keep the code cleaner. It wouldn't be unreasonable for a developer to be surprised that the OkHttp client overrides it when the JWS client doesn't.So I'm going to try something else -- let me know what you think. If my approach ends up having worse drawbacks then we'll revisit this.
And of course, thanks for the help!