This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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() { | |
@Override |