Skip to content

Commit

Permalink
Upgrade to DAS protocol 0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelbranco80 committed Sep 17, 2024
1 parent 6f3fb4f commit c52ad43
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ lazy val root = (project in file("."))
strictBuildSettings,
publishSettings,
libraryDependencies ++= Seq(
"com.raw-labs" %% "protocol-das" % "0.1.1" % "compile->compile;test->test",
"com.raw-labs" %% "protocol-das" % "0.1.2" % "compile->compile;test->test",
"com.raw-labs" %% "das-sdk-scala" % "0.1.0" % "compile->compile;test->test"
)
)
4 changes: 3 additions & 1 deletion src/main/scala/com/rawlabs/das/server/DASServer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

package com.rawlabs.das.server

import com.rawlabs.protocol.das.services.{RegistrationServiceGrpc, TablesServiceGrpc}
import com.rawlabs.protocol.das.services.{HealthCheckServiceGrpc, RegistrationServiceGrpc, TablesServiceGrpc}
import com.rawlabs.utils.core.RawSettings
import io.grpc.{Server, ServerBuilder}

Expand All @@ -23,12 +23,14 @@ class DASServer(implicit settings: RawSettings) {
private val dasSdkManager = new DASSdkManager
private val cache = new DASResultCache()

private val healthCheckService = HealthCheckServiceGrpc.bindService(new HealthCheckServiceGrpcImpl)
private val registrationService = RegistrationServiceGrpc.bindService(new RegistrationServiceGrpcImpl(dasSdkManager))
private val tablesService = TablesServiceGrpc.bindService(new TableServiceGrpcImpl(dasSdkManager, cache))

def start(port: Int): Unit = {
server = ServerBuilder
.forPort(port)
.addService(healthCheckService)
.addService(registrationService)
.addService(tablesService)
.intercept(new ThrowableHandlingInterceptor)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ class RegistrationServiceGrpcImpl(dasSdkManager: DASSdkManager)
logger.debug(s"Registering DAS with type: ${request.getDefinition.getType}")
val dasId = dasSdkManager.registerDAS(
request.getDefinition.getType,
request.getDefinition.getOptionsMap.asScala.toMap
request.getDefinition.getOptionsMap.asScala.toMap,
maybeDasId = if (request.hasId) Some(request.getId) else None
)
responseObserver.onNext(dasId)
responseObserver.onCompleted()
Expand Down

0 comments on commit c52ad43

Please sign in to comment.