aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/xyz/driver/core/rest/SavingUsedServiceDiscovery.scala
blob: 8018bdfc9d5591345e49b65138570db9cb1d0a80 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
package xyz.driver.core.rest

import xyz.driver.core.Name

trait SavingUsedServiceDiscovery {

  private val usedServices = new scala.collection.mutable.HashSet[String]()

  def saveServiceUsage(serviceName: Name[Service]): Unit = usedServices.synchronized {
    usedServices += serviceName.value
  }

  def getUsedServices: Set[String] = usedServices.synchronized { usedServices.toSet }
}