Skip to content

Possibility of firing user event in outbound direction. #4378

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Possibility of firing user event in outbound direction. #4378

wants to merge 2 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Oct 20, 2015

Currently my test fail half-way through, but I don't think it's the issue with the changes. it says:

[ERROR] Failed to execute goal ....:autobahntestsuite-maven-plugin:0.1.3:fuzzingclient (default) on project netty-testsuite: Execution default of goal .....fuzzingclient failed: unable to find a free port

Motivation:

In a proxy application it is desirable to propagate a user event
backward, from proxy destination end-point to client end-point.
Currently the only way is to set a List attribute on
channel context and pass event object to them however benefits of
Netty's event firing (easy access to proper context, exception
handling, ...) is lost.

Modifications:

Very similar to fireUserEventTriggered() and userEventTriggered(), two
method fireUserEventTriggeredOutbound() and userEventTriggeredOutbound()
were added. in the channel handler context implementation instead of
next handler, previous handler is found and called.

Result:

It's possible to send a user event from end of pipeline to the beginning
of it. However the changes are backward-incompatible and direct implementations
of ChannelHandler and ChannelHandlerContext need to implement the
methods.

koosha added 2 commits October 20, 2015 12:44

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Motivation:

In a proxy application it is desirable to propagate a user event
backward, from proxy destination end-point to client end-point.
Currently the only way is to set a List<ChannelHandler> attribute on
channel context and pass event object to them however benefits of
Netty's event firing (easy access to proper context, exception
handling, ...) is lost.

Modifications:

Very similar to fireUserEventTriggered() and userEventTriggered(), two
method fireUserEventTriggeredOutbound() and userEventTriggeredOutbound()
were added. in the channel handler context implementation instead of
next handler, previous handler is found and called.

Result:

It's possible to send a user event from end of pipeline to the beginning
of it. However the changes are backward-incompatible and direct implementations
 of ChannelHandler and ChannelHandlerContext need to implement the
methods.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Rename userEventTriggeredOutbound to userEventTriggeredBackward.
Make event invoker compatible with the new event userEventTriggeredBackward
(previously called userEventTriggeredOutbound).

Modifications:

Added the proper methods to Invoker interface and it's implementations.

Result:

It's possible to send an event from end of pipeline to beginning of it
and capture it via userEventTriggeredBackward() in channel handlers.
@normanmaurer
Copy link
Member

@Scottmitch @trustin @nmittler WDYT ? I think this could be useful, I just think we may need to find a better name :)

@Scottmitch
Copy link
Member

@normanmaurer - Seems reasonable to me. I haven't looked into it too much be here are a few possibilities...

  1. Deprecate fireUserEventTriggered. Introduce fireUserEventTriggeredOutbound and fireUserEventTriggeredInbound.
  2. Add a fireUserEventTriggered(boolean inbound) which the existing fireUserEventTriggered would call fireUserEventTriggered(true). We could also deprecate fireUserEventTriggered if we wanted to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants