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

akka.stream.alpakka.jms.scaladsl.package.scala Maven / Gradle / Ivy

Go to download

Alpakka is a Reactive Enterprise Integration library for Java and Scala, based on Reactive Streams and Akka.

There is a newer version: 6.0.2
Show newest version
/*
 * Copyright (C) since 2016 Lightbend Inc. 
 */

package akka.stream.alpakka.jms
import akka.{Done, NotUsed}
import akka.annotation.InternalApi
import akka.stream.alpakka.jms.impl.InternalConnectionState
import akka.stream.scaladsl.Source

import scala.util.{Failure, Success}

package object scaladsl {
  @InternalApi private[scaladsl] def transformConnectorState(source: Source[InternalConnectionState, NotUsed]) = {
    import InternalConnectionState._
    source.map {
      case JmsConnectorDisconnected => JmsConnectorState.Disconnected
      case _: JmsConnectorConnected => JmsConnectorState.Connected
      case i: JmsConnectorInitializing => JmsConnectorState.Connecting(i.attempt + 1)
      case JmsConnectorStopping(Success(Done)) => JmsConnectorState.Completing
      case JmsConnectorStopping(Failure(t)) => JmsConnectorState.Failing(t)
      case JmsConnectorStopped(Success(Done)) => JmsConnectorState.Completed
      case JmsConnectorStopped(Failure(t)) => JmsConnectorState.Failed(t)
      case other => throw new MatchError(other)
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy