Skip to content

MockTcpTransport to connect asynchronously (#28203)#33476

Merged
Tim-Brooks merged 2 commits intoelastic:6.xfrom
Tim-Brooks:backport_connect_sig_change
Sep 6, 2018
Merged

MockTcpTransport to connect asynchronously (#28203)#33476
Tim-Brooks merged 2 commits intoelastic:6.xfrom
Tim-Brooks:backport_connect_sig_change

Conversation

@Tim-Brooks
Copy link
Copy Markdown
Contributor

The method initiateChannel on TcpTransport is explicit in that
channels can be connect asynchronously. All production implementations
do connect asynchronously. Only the blocking MockTcpTransport
connects in a synchronous manner. This avoids testing some of the
blocking code in TcpTransport that waits on connections to complete.
Additionally, it requires a more extensive method signature than
required for other transports.

This commit modifies the MockTcpTransport to make these connections
asynchronously on a different thread. Additionally, it simplifies that
initiateChannel method signature.

The method `initiateChannel` on `TcpTransport` is explicit in that
channels can be connect asynchronously. All production implementations
do connect asynchronously. Only the blocking `MockTcpTransport`
connects in a synchronous manner. This avoids testing some of the
blocking code in `TcpTransport` that waits on connections to complete.
Additionally, it requires a more extensive method signature than
required for other transports.

This commit modifies the `MockTcpTransport` to make these connections
asynchronously on a different thread. Additionally, it simplifies that
`initiateChannel` method signature.
@Tim-Brooks Tim-Brooks added :Distributed/Network Http and internode communication implementations v6.5.0 labels Sep 6, 2018
@elasticmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-core-infra

@Tim-Brooks
Copy link
Copy Markdown
Contributor Author

This is just a backport.

@Tim-Brooks Tim-Brooks merged commit 15efb2b into elastic:6.x Sep 6, 2018
@Tim-Brooks Tim-Brooks deleted the backport_connect_sig_change branch December 18, 2019 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed/Network Http and internode communication implementations >non-issue v6.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants