mirror of
https://github.com/sbt/sbt.git
synced 2026-09-07 11:01:08 +02:00
[2.x] feat: Notify sbtn client when command is queued (#8568)
Fixes #8356 **Problem** When `sbtn` sends a command while another long-running task (like `console`) is already executing, the client silently blocks with no indication that the command is waiting in a queue. **Solution** When a new command arrives via the network channel and another command is currently running, the server now sends an `ExecStatusEvent` notification with status `"Queued"` to the client. The client displays a message like: ``` [info] waiting for: console ```
This commit is contained in:
@@ -691,6 +691,14 @@ class NetworkClient(
|
||||
}
|
||||
case (`Shutdown`, Some(_)) => Vector.empty
|
||||
case (msg, _) if msg.startsWith("build/") => Vector.empty
|
||||
case ("sbt/exec", Some(json)) =>
|
||||
import sbt.protocol.codec.JsonProtocol.given
|
||||
Converter.fromJson[ExecStatusEvent](json) match {
|
||||
case Success(event) if event.status == "Queued" =>
|
||||
event.message.foreach(m => errorStream.println(s"[info] $m"))
|
||||
Vector.empty
|
||||
case _ => Vector.empty
|
||||
}
|
||||
case _ =>
|
||||
Vector(
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user