Skip to content

Supporting ASGi #286

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

Open
Andrew-Chen-Wang opened this issue Jul 17, 2020 · 10 comments
Open

Supporting ASGi #286

Andrew-Chen-Wang opened this issue Jul 17, 2020 · 10 comments

Comments

@Andrew-Chen-Wang
Copy link

Hi! Thanks for keeping this package alive!

I'm pushing for a lot of async features for Django, and I happened to need web sockets for autocomplete. The Elasticsearch-py documentation specifies that https://elasticsearch-py.readthedocs.io/en/master/async.html#elasticsearch.AsyncElasticsearch we'd need some kind of Connection class but I can't seem to find that for this.

How would I implement this? Thanks!

@safwanrahman
Copy link
Collaborator

I do not know how it is possible. Seems like async connection is new in elasticsearch-py. need to wait untill elasticsearch-dsl supports it.

@Andrew-Chen-Wang
Copy link
Author

https://github.com/elastic/elasticsearch-py/blob/ff73292cc6605579ee93df190322feab274d01fd/elasticsearch/__init__.py#L32

How is the client usually set for Elasticsearch? Is it even set in this repository? It should just be the same way for async.

@safwanrahman
Copy link
Collaborator

@Andrew-Chen-Wang You can set the client while search I think by passing the client manually to elasticsearch-dsl

@Andrew-Chen-Wang
Copy link
Author

Ah I see. So for the Django settings, like this: ELASTICSEARCH_DSL = {"default": {"hosts": "localhost:9200"}} is only meant for passing the args to the Elasticsearch client?

@sethmlarson
Copy link

BTW: There is no native async support in Elasticsearch-DSL but it's on my priority list.

@safwanrahman
Copy link
Collaborator

safwanrahman commented Jul 17, 2020

@Andrew-Chen-Wang Seems like it is not supported by elasticsearch-dsl still! I would suggest you to wait untill it get upstream support.

BTW, Thanks @sethmlarson for keeping eye on this project! 😃😁

@Andrew-Chen-Wang
Copy link
Author

I see, thank you!

@belegnar
Copy link

@Andrew-Chen-Wang
Copy link
Author

@belegnar Seems to just be the low level client. I think this package uses DSL version which doesn't seem to support async yet.

@ttys0dev
Copy link

Looks like support was merged in #1714, is there anything else blocking async support here now that support is merged for elasticsearch-dsl-py?

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

No branches or pull requests

5 participants