Skip to content
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

candidate for async save_doc #113

Open
mcqueenorama opened this issue Sep 11, 2014 · 2 comments
Open

candidate for async save_doc #113

mcqueenorama opened this issue Sep 11, 2014 · 2 comments

Comments

@mcqueenorama
Copy link

Can you have a look at my repo? In particular see examples/async_stream_to_save.erl and examples/async_save_inline.erl.

I don't want to make a pull request for it since its a bit experimental. It exposes the hackney async function to save_doc. I bet there's a better way to do it, but I couldn't figure it out. There's one small change needed in couchbeam_uuids, and the atom async didn't seem to work, but {async, true} does. I had to force the call to get_new_uuids is forced to go syncronously, but that's only rarely used, so its probably OK.

Also it uses hackney_disp.

@benoitc
Copy link
Owner

benoitc commented Oct 28, 2014

Sorry for the late answer, but what would be the purpose? Not waiting for the result but still beeing able to check if it arrived?

In that case I would prefer an api like this one: save_doc(..., [{async, AsyncOption}]) With the possibility to wait for a result in a pid or just ignore it totally. The result would be just {DocId, Result}) Eventually we could add some metadata.

Thoughts?

@benoitc
Copy link
Owner

benoitc commented Jan 2, 2015

ping.

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

2 participants