All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.digitalasset.resources.akka.AkkaResourceOwnerFactories.scala Maven / Gradle / Ivy

There is a newer version: 1.18.2
Show newest version
// Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

package com.daml.resources.akka

import akka.actor.ActorSystem
import akka.stream.Materializer
import com.daml.resources.{AbstractResourceOwner, HasExecutionContext}

trait AkkaResourceOwnerFactories[Context] {
  protected implicit val hasExecutionContext: HasExecutionContext[Context]

  def forActorSystem(acquire: () => ActorSystem): AbstractResourceOwner[Context, ActorSystem] =
    new ActorSystemResourceOwner(acquire)

  def forMaterializer(acquire: () => Materializer): AbstractResourceOwner[Context, Materializer] =
    new ActorMaterializerResourceOwner(acquire)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy