Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using ZIO in Directives? #67

Open
ashwinbhaskar opened this issue Aug 9, 2021 · 0 comments
Open

Using ZIO in Directives? #67

ashwinbhaskar opened this issue Aug 9, 2021 · 0 comments

Comments

@ashwinbhaskar
Copy link

ashwinbhaskar commented Aug 9, 2021

Is it possible to use ZIO in akka directives?

def foo: Directive1[F] = 
withToken.flatMap(
      token =>
        onComplete(
          //some ZIO is returned here
      )
    )

In scenarios like this, what is the way to go forward. One way is to use runtime.unsafeRuntoFuture(someZIO). But isn't this an expensive thing to do (as this directives are called ever time the route is hit) ? Is there any other way to approaching this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant