final class BspBridge extends AnyRef
- Alphabetic
- By Inheritance
- BspBridge
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
Type Members
- case class RunningBspConnection(bsp: BspConnection, logs: ListBuffer[String]) extends Product with Serializable
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
connectToOpenSession(serverConnection: BspConnection): Option[Socket]
Open a client session from the launcher when a bsp server session is available.
Open a client session from the launcher when a bsp server session is available.
A
bloop bsp/ embedded bsp cli invocation opens a bsp server session, but we still need to connect to it so that we can redirect stdin/stdout as the BSP server discovery protocol mandates.- serverConnection
An open bsp server connection.
- returns
A socket if the connection succeeded, none otherwise.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
establishBspConnectionViaBinary(bloopServerCmd: List[String], useTcp: Boolean, attempts: Int = 1): RunningBspConnection
Establish a bsp connection by telling the background server to open a BSP session.
Establish a bsp connection by telling the background server to open a BSP session.
This routine is only called when a background server is running. The retry logic and the waits are done because the server might be still starting up and the bsp command may fail.
The bsp connection will be attempted 5 times with several delays in between. When more than 3 local connections have failed in non Windows systems, we use TCP for the two remaining. After the 5 attempts, we just fail.
- bloopServerCmd
The command we use to run
- useTcp
Whether TCP should be always used or not.
- attempts
How many attempts are allowed before failing to establish a connection.
- returns
An open bsp connection that we need to poll.
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def resetServerStatus(): Unit
- def runEmbeddedBspInvocationInBackground(classpath: Seq[Path], forceTcp: Boolean, jvmOptions: List[String]): RunningBspConnection
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
- def waitForOpenBsp(conn: RunningBspConnection, attempts: Int = 0): Option[BspConnection]
-
def
wireBspConnectionStreams(socket: Socket): Unit
Wires the client streams with the server streams so that they can communicate to each other.
Wires the client streams with the server streams so that they can communicate to each other.
After a connection has been successfully established, we create two threads that will pump contents in the streams in and out in a way that the server receives everything that we read and the client receives everything we read from the server socket stream.
This operation is the last thing the launcher does to set up a bsp connection. We don't care if the operation succeeds or fails nor we have a way to know if an error is legit. If an error happens we report it but return with a successful exit code.
- socket
The socket connection established with the server.