Skip to content

[DOCS] How to reuse the client #245

Open
@chungwong

Description

@chungwong

Please describe the documentation
It not clear how to reuse a client.

let client = Elasticsearch::default();
for _ in 0..10 {
 //               vvvvvvvvvvv cloning, should it?
  send_away(client.clone()).await;
}

The cloning on reqwest::Client is cheap enough but I am not sure the general idea on cloning ElaticSearch, there is credentials which basically just String

Describe where the documentation should for
If it works the same way as reqwest::Client, then a direct copy from reqwest is good enough

You do not have to wrap the Client in an Rc or Arc to reuse it, because it already uses an Arc internally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions