Hi Leon,
On Tue, Nov 24, 2015 at 2:38 PM, Leon Ma <[email protected]> wrote:
> Hi,
>
> Checking below code:
>
> bind(interface, port, settings, httpsContext, log)
> .mapAsyncUnordered(settings.maxConnections) { connection ⇒
> handleOneConnection(connection).recoverWith {
> // Ignore incoming errors from the connection as they will
> cancel the binding.
> // As far as it is known currently, these errors can only happen
> if a TCP error bubbles up
> // from the TCP layer through the HTTP layer to the
> Http.IncomingConnection.flow.
> // See https://github.com/akka/akka/issues/17992
> case NonFatal(_) ⇒ Future.successful(())
> }(fm.executionContext)
> }
> .to(Sink.ignore)
> .run()
>
> It looks like for each connection, 1 flow (defined by handler) will be
> materialized.
>
I don't get the context. What is this code doing? What does
handleOneConnection do? Are you referring to Akka code or your own code?
>
> Does that mean as long as the connection lives, there will only be 1
> materialized stream serves for this connection?
>
Depends what handleOneConnection is doing, but if it connects a handler
flow to the connection flow, then yes, that flow will handle each byte that
arrives from that TCP connection.
> And if the connection dies (like idled out from the connection pool),
>
This looks like a server, how does this relate to a connection pool?
The connection what the BindSource gives is a single incoming TCP
connection. If it fails, then the Flow wrapping it will fail too.
> the stream will stop/terminated as well?
>
It depends what does it do with the failure.
-Endre
>
> Thanks
> Leon
>
>
>
> --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ:
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>
--
Akka Team
Typesafe - Reactive apps on the JVM
Blog: letitcrash.com
Twitter: @akkateam
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.