Skip to content

Instantly share code, notes, and snippets.


Sait Sami Kocataş Deliganli

View GitHub Profile
View fs2-websocket.scala
import cats.effect.{ConcurrentEffect, ContextShift, Timer}
import com.typesafe.scalalogging.StrictLogging
import fs2.concurrent.Queue
import fs2.{Pipe, Stream}
import io.lemonlabs.uri.AbsoluteUrl
import scodec.Codec
import spinoco.fs2.http.HttpClient
import spinoco.fs2.http.websocket.{Frame, WebSocketRequest}
class WSChannelFactory[F[_]: ConcurrentEffect: ContextShift: Timer](client: HttpClient[F]) {
* Measures given view and runs the action provided after that
* @param view to be measured
* @param action to be performed
public static void measure(View view, ViewMeasurer action) {
ViewTreeObserver vto = view.getViewTreeObserver();
if (vto.isAlive()) {
vto.addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {