Hi Jerome,
On 13/06/15 11:43, Jérôme LELEU wrote:
> Hi Tim,
>
> vertx-pac4j is fully async but pac4j has still internal blocking calls. In
> fact, an authentication (with OAuth, CAS, SAML...) will generally generate
> one blocking HTTP call. Not that much considering a full web session of a
> user.
The issue here is not really how long this takes for a single user, it's
more about overall system scalability.
As you know Vert.x is a non blocking system and we do this for
scalability. As soon as we introduce something that blocks in the chain
then we have a potential scalability bottleneck.
If HTTP requests are executed using a blocking API, and let's say we
have 200 threads in a thread pool, and each request takes 500ms then
that means we can never have more than 400 requests per second (even
thought the actual provider e.g. google or facebook can support a much
higher throughput than that).
(Plus there's the added pain of managing another thread pool in the system)
400 requests per second may seem like a lot but I know some of our
customers are considering public facing apps which potentially might
have 10s of millions of users so 400 requests / second doesn't seem such
a lot then...
So we always aim to have non blocking solutions unless it's really not
possible (e.g. with JDBC which is inherently blocking). With OAuth there
doesn't seem anything inherently blocking about it.