You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I might be wrong, but looks like MockWebServer does not allow "endless" responses controlled by writing to body Buffer.
I'm trying to simulate Server Sent Events with setting Buffer as a body of MockResponse and keep connection open via not closing the Buffer. But whatever I do MockWebServer closes connection for me and does not allow me emulate SSE.
Basically, I'd like to keep connection until I explicitly close() body Buffer and be able to write data to socket via writing to body Buffer.
What about adding such API to MockResponse? i.e. MockResponse.setStreamingBody(Buffer body).
The text was updated successfully, but these errors were encountered:
Buffer is not safe for use across threads and it's unclear what MWS would be doing during this. Just spinning in a hot loop or waiting for a notification? We don't have a good type to model this and it would probably need something more sophisticated like RequestBody which can block on the writer thread or web sockets which have their own API.
I might be wrong, but looks like
MockWebServer
does not allow "endless" responses controlled by writing to bodyBuffer
.I'm trying to simulate Server Sent Events with setting
Buffer
as a body ofMockResponse
and keep connection open via not closing theBuffer
. But whatever I doMockWebServer
closes connection for me and does not allow me emulate SSE.Basically, I'd like to keep connection until I explicitly
close()
bodyBuffer
and be able to write data to socket via writing to bodyBuffer
.What about adding such API to
MockResponse
? i.e.MockResponse.setStreamingBody(Buffer body)
.The text was updated successfully, but these errors were encountered: