-
Notifications
You must be signed in to change notification settings - Fork 694
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
22 additions
and
119 deletions.
There are no files selected for viewing
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
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
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
12 changes: 3 additions & 9 deletions
12
elastic4s-core/src/main/scala/com/sksamuel/elastic4s/Executor.scala
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,14 @@ | ||
package com.sksamuel.elastic4s | ||
|
||
import scala.concurrent.{ExecutionContext, Future} | ||
import scala.language.higherKinds | ||
|
||
trait Executor[F[_]] { | ||
def exec(client: HttpClient[F], request: ElasticRequest): F[HttpResponse] | ||
} | ||
|
||
object Executor { | ||
def apply[F[_]](implicit ev: Executor[F]): Executor[F] = ev | ||
|
||
def apply[F[_]: Executor]: Executor[F] = implicitly[Executor[F]] | ||
|
||
implicit def FutureExecutor(implicit ec: ExecutionContext = ExecutionContext.Implicits.global): Executor[Future] = | ||
new Executor[Future] { | ||
override def exec(client: HttpClient[Future], request: ElasticRequest): Future[HttpResponse] = { | ||
client.send(request) | ||
} | ||
} | ||
implicit def defaultExecutor[F[_]]: Executor[F] = | ||
(client: HttpClient[F], request: ElasticRequest) => client.send(request) | ||
} |
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
14 changes: 0 additions & 14 deletions
14
...-effect-cats-2/src/main/scala/com/sksamuel/elastic4s/cats/effect/CatsEffectExecutor.scala
This file was deleted.
Oops, something went wrong.
12 changes: 3 additions & 9 deletions
12
...s-2/src/main/scala/com/sksamuel/elastic4s/cats/effect/instances/CatsEffectInstances.scala
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
14 changes: 0 additions & 14 deletions
14
...4s-effect-cats/src/main/scala/com/sksamuel/elastic4s/cats/effect/CatsEffectExecutor.scala
This file was deleted.
Oops, something went wrong.
12 changes: 3 additions & 9 deletions
12
...ats/src/main/scala/com/sksamuel/elastic4s/cats/effect/instances/CatsEffectInstances.scala
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
9 changes: 0 additions & 9 deletions
9
elastic4s-effect-monix/src/main/scala/com/sksamuel/elastic4s/monix/TaskExecutor.scala
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
...4s-effect-monix/src/main/scala/com/sksamuel/elastic4s/monix/instances/TaskInstances.scala
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
package com.sksamuel.elastic4s.monix.instances | ||
|
||
import com.sksamuel.elastic4s.Functor | ||
import com.sksamuel.elastic4s.monix.TaskExecutor | ||
import monix.eval.Task | ||
|
||
trait TaskInstances { | ||
implicit val taskFunctor: Functor[Task] = new Functor[Task] { | ||
override def map[A, B](fa: Task[A])(f: A => B): Task[B] = fa.map(f) | ||
} | ||
|
||
implicit val taskExecutor: TaskExecutor = new TaskExecutor | ||
} |
9 changes: 0 additions & 9 deletions
9
elastic4s-effect-scalaz/src/main/scala/com/sksamuel/elastic4s/scalaz/TaskExecutor.scala
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
...-effect-scalaz/src/main/scala/com/sksamuel/elastic4s/scalaz/instances/TaskInstances.scala
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
package com.sksamuel.elastic4s.scalaz.instances | ||
|
||
import com.sksamuel.elastic4s.Functor | ||
import com.sksamuel.elastic4s.scalaz.TaskExecutor | ||
import scalaz.concurrent.Task | ||
|
||
trait TaskInstances { | ||
implicit val taskFunctor: Functor[Task] = new Functor[Task] { | ||
override def map[A, B](fa: Task[A])(f: A => B): Task[B] = fa.map(f) | ||
} | ||
|
||
implicit val taskExecutor: TaskExecutor = new TaskExecutor | ||
} |
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
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
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
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
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
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
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
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