rossabaker on 0.23
Update fs2-core, fs2-io, ... to… Set buffer size to 1 Merge pull request #5406 from s… (compare)
rossabaker on 0.22
Add upgrade docs over +? goign … Merge pull request #5379 from z… (compare)
rossabaker on 0.22
Add server connection suite Add TestClient class for reuse scalafmt and 4 more (compare)
rossabaker on 1.0
http4s-0.21.29 Merge pull request #235 from ht… Merge pull request #236 from ht… and 16 more (compare)
case Ok(resp) =>. And there are extractors for the classes, so you can do things like
case ClientError(resp) =>. And then you can write something like
expectcan be implemented in terms of
fetch, in fact.
We're using IO.shift(someIoBoundContext) to get work off of the execution context we use to respond to http requests. I'd like to keep that concern with the io-bound part of the system, and IO.shift back to the calling context after the slow work is done. IO.bracket() seems like the right method . The missing piece is the current execution context.
Is there some API to get the current execution context from IO?
IOApp. It cannot keep track of several jumps across different ECs
to get work off of the execution context we use to respond to http requests.
Why are you doing that? is the IO you are dealing with actually blocking?
@SystemFw - what will happen if I don't have an IOApp? The system runs in a servlet, so my guess is it'll use the context specified there.
Some parts are blocking (old slick database code - IO.fromFuture), some are more blocking (even older squyril database code - no Future (in so many ways)), some are really blocking (deeply buried http request/responses) and some are ridiculously blocking (http request/response to someone else's system with a 30-second timeout).
Thanks @nigredo-tori . "pass it everywhere implicitly" is 9 layers deep in this code base. Implicit cake is too hard to do. (I'm also skeptical of the clarity of the code that would result even if it were feasible.)
Is there any harm in making a new ContextShift precisely where it's used?
Is there a
MediaType literal parser like
Uri.uri or do I have to wait until runtime to parse those?
Relatedly, is there an easy way to override the media types used by the JSON codecs? I'm writing a client for an API that uses
application/vnd.dwolla.v1.hal+json (and specifically rejects
application/json) so I want it to specify that media type as my
Accept headers any time I ask for or provide circe Json objects.
jsonOfWithMediawhich could help on the decoder side.
withContentTypeon the encoder.
Json, providing your own custom media type.