Hello,

what is the best way to proceed with blocking operation ?


1. Rise up the number of thread of the default-dispatcher  or change it to 
fixed size thread pool?

or

2. don't touch default values for default-dispatcher and use another 
dispatcher (eg : my-blocking-dispatcher) with a fixed size thread pool?



What is the criteria to determine if this is a blocking operation or not ? 
By example, is this code blocking or not ?


path(PathMatchers.segment("uuid-v4")
                .slash(PathMatchers.integerSegment()), count ->
                get(() -> {
                    final Source<ByteString, ?> source = Source
                        .fromIterator(
                            () ->
                                Stream.generate(() ->
                                    UUID.randomUUID().toString() + "\n"
                                ).iterator()
                        )
                        .map(ByteString::fromString)
                        .take(count < 100000 ? count : 100000);
                    return complete(HttpResponse.create()
                        .withEntity(
                            HttpEntities.createChunked(ContentTypes.
TEXT_PLAIN_UTF8, source)
                        )
                    );
                })
            ),



Thanks

-- 
>>>>>>>>>>      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 https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to