...
ID | IEP-51 |
Author | |
Sponsor | |
Created | |
Status | Status |
---|
| |
---|
colour | GreyGreen |
---|
title | DRAFTCOMLETED |
---|
|
|
Motivation
Do not block user threads when performing async thin client operations.
IEP-51 introduced async API to the Java thin client, but socket writes are still performed on the user thread and are potentially blocking.
Description
TODO: Describe potential approaches with pros and cons
Discussion Links
...
Potential approaches to this are:
- GridNioServer
- Pros:
- Easy to use, provides Future-based API
- No extra dependencies
- Supports multiplexing (shared worker thread group across multiple connections)
- Cons:
- Possibly not future proof - Ignite 3.0 may change how GridNioServer works and/or switch to Netty
- Netty
- Pros:
- Easy to use, provides Future-based API
- Supports multiplexing (shared worker thread group (EventLoopGroup) across multiple connections)
- Proven performance
- Cons:
- New dependency in core module
- Perform writes in a separate thread (use dedicated thread or ForkJoinPool.commonPool)
- Pros:
- Cons:
- Increased resource usage,
- More manual thread management - hard to get right and fast
- AsynchronousSocketChannel
- Pros:
- Native Java API, no dependencies
- Cons:
As a result of dev list discussions (see links below), it is decided to use GridNioServer. To make the integration clean and easy to replace with a different implementation, a couple of facade interfaces are introduced:
- ClientConnectionMultiplexer
- void start()
- void stop()
- ClientConnection open(InetSocketAddress addr, Consumer<ByteBuffer> hnd)
- ClientConnection
- CompletableFuture sendAsync(ByteBuffer msg)
Discussion Links
...
...
...
...
...
...
...
...
Tickets
Jira |
---|
server | ASF JIRA |
---|
serverId | 5aa69414-a9e9-3523-82ec-879b028fb15b |
---|
key | IGNITE-13496 |
---|
|