Comments (8)
I guess the idea is you can pass in your own execution context if you think it might become a bottleneck.
If we move to using a Promise that we complete using an action listener, then the bottleneck moves to the underlying elasticsearch client executor, right? If so, what's the advantage?
I'm not against the idea of doing it this way, I just need to better understand the advantage.
from elastic4s.
ES java client manages it's own thread pool. If we make a blocking call in a single client-wide ExecutionContext
, the intermediate thread will be blocked and the ES thread pool won't be fully utilized.
from elastic4s.
I see that we are thinking about slightly different cases.
I am using the case that people will use the client as a non data node (using transport client for example), in which case the client has its own thread pool that is no different to the a thread pool you can specify to the e4s client. I think you're using the case where your client is also a data node, in which case using ES's own thread pool might be better.
Perhaps we can solve this by adding in the callback methods you suggest, but keeping the "internal thread pool" ones as well? What do you think ?
from elastic4s.
In usual, when you send an async request via a transport client, it registers a callback on it's internal thread pool and the pool will notify when it's done. Additional requests will be handled in the same manner.
However, by blocking request inside a shared execution context, additional ones won't be sent until the previous one is done and the thread pool will hold only one request at once like this:
from elastic4s.
There should be Elastic4s client between 'User' and 'ExecutionContext'..
from elastic4s.
Yes I see what you mean. I'll follow up tonight with some conversion work, or you can start on a branch if you want.
from elastic4s.
take a look over what I've done, feedback very much welcome.
from elastic4s.
Thanks :) I'll send a following PR in a few days.
from elastic4s.
Related Issues (20)
- Using REST API compatibility
- Support for highlights in TopHitsAggregation
- Elasticsearch server version for tests is not up-to-date and tests are failing when updating HOT 2
- SearchHit.sourceAsString adds superfluous type metadata HOT 2
- IndicesExistsRequest with allowNoIndices = true always returns true HOT 1
- `getIndex` doesn't support date math in index aliases HOT 1
- `indexExists` always returns `true` if index string contains `*` HOT 2
- `.sourceExclude` and `.sourceInclude` are mutually exclusive HOT 1
- docAsUpsert not working as expected
- ElasticSource does not clear it's scroll HOT 1
- Add Synonyms API support HOT 3
- Is there anyway to stream the agg query? HOT 1
- ReindexRequest doesn't support versionType parameter
- I/O reactor status : STOPPED HOT 2
- GetSynonymsSetResponse.synonymsSet is null HOT 1
- DenseVectorField lacks index_options parameter
- Knn query lacks inner_hits field
- Performance bug in BulkHandlers HOT 3
- Use testcontainers-scala in tests to launch Elasticsearch instance HOT 2
- Should ElasticClient accept authentication settings? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elastic4s.