Skip to main content

All Questions

Tagged with
0 votes
0 answers
150 views

Is it safe run blocking call in OS executor when using virtual thread?

When using virtual thread, can I safely use a separate thread pool while interacting with a library we don't have a control over, such as HikariCP DB connection manager, which uses synchronized blocks,...
LoranceChen's user avatar
  • 2,541
1 vote
2 answers
447 views

When to use scala.concurrent.blocking?

I am asking myself the question: "When should you use scala.concurrent.blocking?" If I understood correctly, the blocking {} only makes sense to be used in conjunction with the ForkJoinPool. ...
Felix's user avatar
  • 1,197
0 votes
0 answers
274 views

Cats-effect 3 - IO hangs after a while in concurrent fs2 streams

I'm trying to run a fs2 application in a gcp e2-small, 0.5 vCPUs core machine. Therefore I'm seeing only io-compute-0 & io-compute-1 thread names in the logs. In the application, There are 2 fs2....
tharindu_DG's user avatar
  • 9,163
0 votes
2 answers
121 views

Could Java(Scala) blocking queue allows queue jumper(higher priority)?

One could use LinkedBlockingQueue to block the operations. Suppose I have only 1 element in queue, and every one could use it. val q = new LinkedBlockingQueue() // 1 element in it def fun() = { val ...
Litchy's user avatar
  • 673
0 votes
1 answer
84 views

Play framework scala POST and Future

I have this action in my controller def doRegister = Action { implicit request => Future { Thread.sleep(5000) } Ok("") } This is the route POST /api/checkout/register ...
Julien D's user avatar
  • 1,267
1 vote
1 answer
678 views

Is scala.io.StdIn.readLine() a blocking call?

Is scala.io.StdIn.readLine() a blocking call? From the docs, there is no mention of it being a blocking call. I want to do something like this: while(true){ val input = scala.io.StdIn.readLine()...
Gimme the 411's user avatar
5 votes
1 answer
326 views

How can I set a timeout for a blocking call?

I have a multi-threaded chat server working with multiple clients (each client is being handled in a new thread). If a client disconnects, the relevant thread on the server hangs on inputstream....
Gimme the 411's user avatar
0 votes
0 answers
36 views

Why does my db read block my play framework server?

I have a mySQL db hosted on AWS RDS and Play framework server using AWS EC2 instance. All of my other API endpoints work fine, but every time multiple connections are made to my db, my server seems to ...
D. Park's user avatar
  • 23
0 votes
1 answer
108 views

How does Play framework track the blocked client and returns the response

The question is about Play framework specifically although concept is generic. I guess that the blocked client is listening to a socket which is tracked on the server side and passed around with the ...
Asad Iqbal's user avatar
  • 3,321
0 votes
1 answer
325 views

Future in scala cann't run asynchronously when the future number larger than cpu core number

I used Future to implement a multi-thread function in scala language. But when the future number lager than cpu core number, the threads were splited to groups. And the threads in one group completed, ...
firefly's user avatar
0 votes
1 answer
216 views

Blocking Operation in Actor NOT Occupying All Default Dispatchers

I am learning Akka Actor recently. I read the document of dispatchers in Actor. I am curious about the blocking operation in an actor. The last topic in the document describes how to solve the problem....
jiexray's user avatar
  • 335
2 votes
1 answer
970 views

Scala MongoDB Driver - How to perform blocking on Observable and Inserting

So I have 2 collection, lets say its new collection and other collection and I wanted to insert data from this other collection to a whole new collection in which the other collection contains data ...
Bilbatez's user avatar
  • 181
1 vote
2 answers
457 views

Akka actor pool for blocking requests

I am trying to use a thread pool to make blocking requests. The problem is, each request is blocking the whole pool and items are process sequentially. Not sure if this is even possible. Somebody ...
Joe's user avatar
  • 1,020
0 votes
1 answer
98 views

Scala chat application, blocking issue

I'm writing a chat application in Scala, the problem is with the clients, the client reads from StdIn (which blocks) before sending the data to the echo server, so if multiple clients are connected ...
user2069328's user avatar
8 votes
0 answers
904 views

"Best" ExecutionContext for IO

I have some synchronous calls in my Scala code. I've wrapped them in a blocking() context and then in a Future: Future(blocking(syncCall())), but I don't know which type of ExecutionContext to use. ...
vicaba's user avatar
  • 2,856

15 30 50 per page