Skip to content

Commit

Permalink
Virtual threads
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Deandrea <[email protected]>
  • Loading branch information
edeandrea committed Jan 5, 2024
1 parent 073fd35 commit 58d07f0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
1 change: 0 additions & 1 deletion grpc-locations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire-plugin.version}</version>
<configuration>
<argLine>-Djdk.tracePinnedThreads</argLine>
<systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,17 @@ import io.quarkus.sample.superheroes.location.grpc.LocationsGrpc.LocationsImplBa
import io.quarkus.sample.superheroes.location.mapping.LocationMapper
import io.quarkus.sample.superheroes.location.service.LocationService
import io.smallrye.common.annotation.Blocking
import io.smallrye.common.annotation.RunOnVirtualThread

@GrpcService
class LocationGrpcService(private val locationService: LocationService) : LocationsImplBase() {
@Blocking
@RunOnVirtualThread
override fun getRandomLocation(request: RandomLocationRequest?, responseObserver: StreamObserver<Location>?) {
Log.debug("Requesting a random location")
returnLocationOrError(this.locationService.getRandomLocation(), responseObserver)
responseObserver?.onCompleted()
}

@Blocking
@RunOnVirtualThread
override fun getLocationByName(request: GetLocationRequest?, responseObserver: StreamObserver<Location>?) {
if (request != null) {
Log.debug("Getting location ${request.name}")
Expand All @@ -32,7 +29,6 @@ class LocationGrpcService(private val locationService: LocationService) : Locati
}

@Blocking
@RunOnVirtualThread
override fun replaceAllLocations(request: LocationsList?, responseObserver: StreamObserver<ReplaceAllLocationsResponse>?) {
if (request != null) {
Log.debug("Replacing all locations")
Expand All @@ -47,7 +43,6 @@ class LocationGrpcService(private val locationService: LocationService) : Locati
}

@Blocking
@RunOnVirtualThread
override fun getAllLocations(request: AllLocationsRequest?, responseObserver: StreamObserver<LocationsList>?) {
val allLocations = this.locationService.getAllLocations()
Log.debug("Got all locations: $allLocations")
Expand All @@ -60,7 +55,6 @@ class LocationGrpcService(private val locationService: LocationService) : Locati
}

@Blocking
@RunOnVirtualThread
override fun deleteAllLocations(request: DeleteAllLocationsRequest?, responseObserver: StreamObserver<DeleteAllLocationsResponse>?) {
Log.debug("Deleting all locations")

Expand Down

0 comments on commit 58d07f0

Please sign in to comment.