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

write_stream: terminate handler function #352

Closed
bart6114 opened this issue Apr 2, 2016 · 2 comments
Closed

write_stream: terminate handler function #352

bart6114 opened this issue Apr 2, 2016 · 2 comments

Comments

@bart6114
Copy link

bart6114 commented Apr 2, 2016

According to the help page on write_stream(f):

f: Callback function. It should have a single argument, a raw vector containing the bytes recieved from the server. This will usually be 16k or less. It should return the length of bytes processed - if this is less than the input length, the function will terminate.

However, I don't think it currently checks the returned length of bytes processed. For example the below code will process just fine.

GET("https://jeroenooms.github.io/data/diamonds.json",
    write_stream(function(x) {
      print(length(x))
      return(NULL)  # or any value
    })
)

Ideally I would like some way to terminate the handler (not just when the stream ends).

@hadley
Copy link
Member

hadley commented May 20, 2016

@jeroenooms is this an rcurl problem? Or am I passing the function in the wrong way?

@hadley
Copy link
Member

hadley commented May 20, 2016

Oh just read the curl thread. I'll update the docs.

@hadley hadley closed this as completed in 2b09b32 May 20, 2016
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