libcpr / cpr

C++ Requests: Curl for People, a spiritual port of Python Requests.
https://docs.libcpr.org/
Other
6.29k stars 903 forks source link

Question: Is `WriteCallback` asynchronous? #1023

Closed vymao closed 4 months ago

vymao commented 4 months ago

I'm curious how WriteCallback functions exactly. If send multiple requests synchronously with a WriteCallback, does cpr call WriteCallback in a separate thread? Or will my function block until each request receives a callback in order?

COM8 commented 4 months ago

It's basically a wrapper around CURLOPT_WRITEFUNCTION. More information is available here: https://curl.se/libcurl/c/CURLOPT_WRITEFUNCTION.html