AdamChlupacek on upgrade-to-fs2.3
Address review comments, remove… (compare)
AdamChlupacek on upgrade-to-fs2.3
Fix travis dependencies. (compare)
AdamChlupacek on 0.5
Fix travis dependencies. (compare)
AdamChlupacek on upgrade-to-fs2.3
Setting version to 0.4.0-SNAPSH… Updated to fs2 1.0.0 final Fixes #29 and 16 more (compare)
AdamChlupacek on 0.5
Merge branch 'series/0.4' of gi… (compare)
AdamChlupacek on upgrade-to-fs2.3
Migrate fs2-http to fs2 2.3.0 +… (compare)
in
will be a stream from the websocket. The output type will be the return type of your callback.
Frame
according to the readme. I.e. this translates between the binary representation sent to the server, and your scala objects. You can get help for that on the scodec channel; I can help out here too.
case class EventSocket[F[_]](myShard: Int, maxShards: Int, queue: Queue[F, Event])(implicit concurrent: Concurrent[F]) {
def wsPipe(matcher: EventMatcher, handler: PartialFunction[Event, Option[Event]]): Pipe[F, Frame[String], Frame[String]] = { inbound =>
val output = queue.dequeue.map(e => Frame.Text(e.asJson.noSpaces))
output.concurrently(inbound.flatMap { in =>
val json: Json = parse(in.a).right.toOption.get
val matched: Stream[F, Option[Event]] = matcher[F](json)
val handeled: Stream[F, Option[Event]] = matched.map(_.flatMap(handler))
val queued: Stream[F, Unit] = handeled.flatMap(_.fold[Stream[F, Unit]](Stream.empty)(e => Stream.eval(queue.enqueue1(e))))
queued
})
}
}
Am I doing this correctly?
Media Type must be text, but is DefaultMediaType(application,json,true,true,WrappedArray(json))
How do I fix this? I'm using circe, should I just do bodyAs[Json]
instead?
java.lang.Throwable: Failed to decode value: cannot acquire 16526844176 bits from a vector that contains 728 bits, content: ByteVector(95 bytes, 0x7b2274223a6e756c6c2c2273223a6e756c6c2c226f70223a31302c2264223a7b226865617274626561745f696e74657276616c223a34313235302c225f7472616365223a5b22676174657761792d7072642d6d61696e2d6b673677225d7d7d)
Why does fs2-http want 2GB
HttpCredentials.DigestHttpCredentials
header in form of DigestHttpCredentials(mpPlaintextCredentials.text, Map.empty)
this should be encoded into the form you require.