Skip to content

Commit

Permalink
server should use the answerLoopPriority
Browse files Browse the repository at this point in the history
  • Loading branch information
badetitou committed Feb 5, 2024
1 parent da56f67 commit 97b1e15
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/PharoLanguageClient/TPLCClient.trait.st
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ TPLCClient >> startWithLocalServer [
self clientInit.
server := PLSServer new.
server debugMode: true.
server serverLoopPriority: Processor lowIOPriority.
server answerLoopPriority: Processor lowIOPriority.
self answerLoopPriority: Processor lowIOPriority.
serverProcess := [ server start ]
forkAt: Processor activeProcess priority
Expand Down
2 changes: 1 addition & 1 deletion src/PharoLanguageProtocol-Tests/PLPTests.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ PLPTests >> setUp [
client := PLPDummyClient new.
server := PLPDummyServer new.
server debugMode: true.
server serverLoopPriority: Processor activeProcess priority.
server answerLoopPriority: Processor activeProcess priority.
client answerLoopPriority: Processor activeProcess priority.
serverProcess := [ server start ]
forkAt: Processor activeProcess priority
Expand Down
26 changes: 3 additions & 23 deletions src/PharoLanguageServer/PLSAbstractServer.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ Class {
'clientInStream',
'clientOutStream',
'lastId',
'withStdIO',
'serverLoopPriority',
'answerLoopPriority'
'withStdIO'
],
#category : #PharoLanguageServer
}
Expand Down Expand Up @@ -175,7 +173,7 @@ PLSAbstractServer >> handleRequest: request toClient: clientSocket [
[ self removeMessageProcess: jrpcMessage id ]
on: KeyNotFound
do: [ ] ]
forkAt: self serverLoopPriority
forkAt: self answerLoopPriority
named: jrpcMessage id printString)
]

Expand Down Expand Up @@ -217,11 +215,6 @@ PLSAbstractServer >> initializeStreams [
ofType: PLSMessageType info ]
]

{ #category : #accessing }
PLSAbstractServer >> log: everything [
everything printString record
]

{ #category : #'lsp - message' }
PLSAbstractServer >> logMessage: aString ofType: messageType [
"The show message notification is sent from a server to a client to ask the client to display a particular message in the user interface"
Expand Down Expand Up @@ -290,19 +283,6 @@ PLSAbstractServer >> serverInitialized [
self subclassResponsibility
]

{ #category : #accessing }
PLSAbstractServer >> serverLoopPriority [

"You can change my priority with you need even more performance for the server loop (note that it might be a bad idea to change me)"
^ serverLoopPriority
]

{ #category : #accessing }
PLSAbstractServer >> serverLoopPriority: anObject [

serverLoopPriority := anObject
]

{ #category : #'lsp - initialization' }
PLSAbstractServer >> serverShutdown [
<jrpc: #shutdown>
Expand Down Expand Up @@ -364,7 +344,7 @@ PLSAbstractServer >> start [
request := self extractRequestFrom: clientInStream.
('Request: ' , request) recordDebug.
self handleRequest: request toClient: clientOutStream ] ]
forkAt: self serverLoopPriority
forkAt: self answerLoopPriority
named: 'JRPC TCP connection'
]

Expand Down

0 comments on commit 97b1e15

Please sign in to comment.