-
Notifications
You must be signed in to change notification settings - Fork 94
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
15 changed files
with
73 additions
and
61 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
6 changes: 4 additions & 2 deletions
6
...c/main/scala/pl/touk/nussknacker/ui/configloader/ProcessingTypeConfigsLoaderFactory.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,14 +1,16 @@ | ||
package pl.touk.nussknacker.ui.configloader | ||
|
||
import cats.effect.IO | ||
import com.typesafe.config.Config | ||
import sttp.client3.SttpBackend | ||
|
||
import scala.concurrent.{ExecutionContext, Future} | ||
|
||
trait ProcessingTypeConfigsLoaderFactory { | ||
|
||
def create( | ||
designerConfigLoadedAtStart: DesignerConfig, | ||
sttpBackend: SttpBackend[Future, Any], | ||
configLoaderConfig: Config, | ||
sttpBackend: SttpBackend[IO, Any], | ||
)(implicit ec: ExecutionContext): ProcessingTypeConfigsLoader | ||
|
||
} |
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
2 changes: 1 addition & 1 deletion
2
...cker/ui/configloader/DesignerConfig.scala → ...ussknacker/ui/config/DesignerConfig.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
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
27 changes: 27 additions & 0 deletions
27
...er/server/src/main/scala/pl/touk/nussknacker/ui/util/IOToFutureSttpBackendConverter.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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package pl.touk.nussknacker.ui.util | ||
|
||
import cats.arrow.FunctionK | ||
import cats.effect.IO | ||
import sttp.client3.SttpBackend | ||
import sttp.client3.impl.cats.implicits.sttpBackendToCatsMappableSttpBackend | ||
import sttp.monad.FutureMonad | ||
|
||
import scala.concurrent.Future | ||
|
||
object IOToFutureSttpBackendConverter { | ||
|
||
def convert( | ||
ioBackend: SttpBackend[IO, Any] | ||
)(implicit executionContextWithIORuntime: ExecutionContextWithIORuntime): SttpBackend[Future, Any] = { | ||
import executionContextWithIORuntime.ioRuntime | ||
ioBackend.mapK( | ||
new FunctionK[IO, Future] { | ||
override def apply[A](io: IO[A]): Future[A] = io.unsafeToFuture() | ||
}, | ||
new FunctionK[Future, IO] { | ||
override def apply[A](future: Future[A]): IO[A] = IO.fromFuture(IO.pure(future)) | ||
} | ||
)(new FutureMonad) | ||
} | ||
|
||
} |
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