Skip to content

Commit

Permalink
Clean up implicit types
Browse files Browse the repository at this point in the history
  • Loading branch information
farmdawgnation committed Aug 17, 2024
1 parent c876c50 commit 7770e7a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion core/src/main/scala/defaults.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import io.netty.util.{HashedWheelTimer, Timer}
import org.asynchttpclient.DefaultAsyncHttpClientConfig.Builder
import org.asynchttpclient._

import scala.concurrent.ExecutionContext

import java.time.Duration

object Defaults {
implicit def executor = scala.concurrent.ExecutionContext.Implicits.global
implicit def executor: ExecutionContext = ExecutionContext.Implicits.global

implicit lazy val timer: Timer = InternalDefaults.timer
}
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/scala/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ package object dispatch {
/** Type alias for URI, avoid need to import */
type Uri = java.net.URI

implicit def implyRequestHandlerTuple(builder: Req) =
implicit def implyRequestHandlerTuple(builder: Req): dispatch.RequestHandlerTupleBuilder =
new RequestHandlerTupleBuilder(builder)


implicit def implyRunnable[U](f: () => U) = new java.lang.Runnable {
implicit def implyRunnable[U](f: () => U): Runnable = new java.lang.Runnable {
def run() = { f(); () }
}

implicit def enrichFuture[T](future: Future[T]) =
implicit def enrichFuture[T](future: Future[T]): dispatch.EnrichedFuture[T] =
new EnrichedFuture(future)

/** Type alias to scala.concurrent.Future so you don't have to import */
Expand Down

0 comments on commit 7770e7a

Please sign in to comment.