Skip to content

Commit

Permalink
Remove unused Timer constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
rossabaker committed Sep 16, 2018
1 parent e17f1aa commit 6f5c0a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ object AsyncHttpClient {
* @param config configuration for the client
* @param ec The ExecutionContext to run responses on
*/
def apply[F[_]: Timer](config: AsyncHttpClientConfig = defaultConfig)(
def apply[F[_]](config: AsyncHttpClientConfig = defaultConfig)(
implicit F: ConcurrentEffect[F]): Client[F] = {
val client = new DefaultAsyncHttpClient(config)
Client(
Expand All @@ -63,10 +63,10 @@ object AsyncHttpClient {
*/
def stream[F[_]](config: AsyncHttpClientConfig = defaultConfig)(
implicit F: ConcurrentEffect[F],
timer: Timer[F]): Stream[F, Client[F]] =
): Stream[F, Client[F]] =
Stream.bracket(F.delay(apply(config)))(_.shutdown)

private def asyncHandler[F[_]: Timer](cb: Callback[DisposableResponse[F]])(
private def asyncHandler[F[_]](cb: Callback[DisposableResponse[F]])(
implicit F: ConcurrentEffect[F]) =
new StreamedAsyncHandler[Unit] {
var state: State = State.CONTINUE
Expand Down Expand Up @@ -117,7 +117,7 @@ object AsyncHttpClient {
}
}

private def toAsyncRequest[F[_]: ConcurrentEffect: Timer](request: Request[F]): AsyncRequest = {
private def toAsyncRequest[F[_]: ConcurrentEffect](request: Request[F]): AsyncRequest = {
val headers = new DefaultHttpHeaders
for (h <- request.headers)
headers.add(h.name.toString, h.value)
Expand All @@ -128,7 +128,7 @@ object AsyncHttpClient {
.build()
}

private def getBodyGenerator[F[_]: ConcurrentEffect: Timer](req: Request[F]): BodyGenerator = {
private def getBodyGenerator[F[_]: ConcurrentEffect](req: Request[F]): BodyGenerator = {
val publisher = StreamUnicastPublisher(
req.body.chunks.map(chunk => Unpooled.wrappedBuffer(chunk.toArray)))
if (req.isChunked) new ReactiveStreamsBodyGenerator(publisher, -1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ package asynchttpclient
import cats.effect.{IO, Resource}

class AsyncHttpClientSpec extends ClientRouteTestBattery("AsyncHttpClient") {
def clientResource = Resource.make(IO(AsyncHttpClient()))(_.shutdown)
def clientResource = Resource.make(IO(AsyncHttpClient[IO]()))(_.shutdown)
}

0 comments on commit 6f5c0a0

Please sign in to comment.