-
-
Notifications
You must be signed in to change notification settings - Fork 251
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
rough draft wip for ws on AkkaHttp #196
Conversation
…is no apparent/intentional functional change Minor progress on ws solution for AkkaHttpAdapter
val apiRoute: Route = AkkaHttpAdapter.makeHttpServiceM(interpreter) | ||
val wsApiRoute = { | ||
// when do we create subscriptions? When do we make it effectful/unsafe? | ||
// val subscriptions: UIO[Ref[Map[String, Fiber[Throwable, Unit]]]] = Ref.make(Map.empty[String, Fiber[Throwable, Unit]]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
subscriptions
should be created inside the adapter, the end-user don't need to see it. A new Ref
should be created for each WS connection.
} ~ path("graphiql") { | ||
getFromResource("graphiql.html") | ||
} | ||
|
||
// convention is normally 8080. Keep at 8088? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because so many services use 8080, I always end up with conflicts. I'd prefer to keep 8088 for this reason.
…is no apparent/intentional functional change Minor progress on ws solution for AkkaHttpAdapter
# Conflicts: # examples/src/main/scala/caliban/akkahttp/ExampleApp.scala
# Conflicts: # examples/src/main/scala/caliban/akkahttp/ExampleApp.scala
…eateFlow, createSource, route for ws/graphql, use handleMessagesWithSinkSource with subprotocol
…ketRoute respectively Added wrappers to Akka example interpreter removed silencer in sbt for AkkaHttp project onGraphQLResponse is now almost identical to http4s version processMessage is now almost identical to http4s version except shortcoming of stop handling, which needs more work removed prints pending issues: mutations: return only partial data unlike http4s lifecycle of subscriptions is unclear and could be quite wrong. For instance when routes are created multiple times from Caliban we see loads of duplicate answers, though that's not necessarily a susbscription issue. It's not perfectly clear when it should be recreated (done in createSink) definition and usage trait Protocol with Complete, Fail is suspect (see createSource usage of Source.actorRef comment below) processMessage, connection terminate case should close cleanly and it's not immediately obvious how to do it (possibly some via hook in createSink/Flow) usage of Actor to send messages back is weak in terms of back-pressure. Akka Http and Streams users recommend instead using some kind of queue. This needs investigation. createSource usage of Source.actorRef requires a CompletionMatcher and FailureMatcher and it's not clear how we should handle those.
Comments on where we stand here.
Pending issues:
|
subsumed by #219. |
Minor progress on ws solution for AkkaHttpAdapter, stuck when using Altair
some potential proposal of refactoring of Http4sAdapter though there is no apparent/intentional functional change. I personally like it better, but it's not needed for sure for this PR.