All Downloads are FREE. Search and download functionalities are using the official Maven repository.

iota.std.package.scala Maven / Gradle / Ivy

There is a newer version: 2.0.0-RC3
Show newest version
package iota

import android.os.{Looper, Handler}
import android.util.Log

import scala.concurrent.ExecutionContext

/**
  * @author pfnguyen
  */
package object std {

  /** UI execution context, use with combinators such as `defer` and `deferF`
    */
  // https://bitbucket.org/snippets/atlassianlabs/pLMry#file-no-implicit-objects.md
  implicit val MainThreadExecutionContext: ExecutionContext = new ExecutionContext {
    private[this] lazy val handler = new Handler(Looper.getMainLooper)
    override def execute(runnable: Runnable) = handler.post(runnable)
    override def reportFailure(t: Throwable) = Log.e("IOTA", t.getMessage, t)
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy