- enable scalariform for akka transcode

This commit is contained in:
Richard Alam 2019-03-27 15:00:37 -07:00
parent bee4b79b51
commit a687b71fc1
6 changed files with 44 additions and 18 deletions

View File

@ -0,0 +1,31 @@
#alignArguments=false
alignParameters=true
alignSingleLineCaseStatements=true
#alignSingleLineCaseStatements.maxArrowIndent=40
#allowParamGroupsOnNewlines=false
#compactControlReadability=false
#compactStringConcatenation=false
danglingCloseParenthesis=Force
#doubleIndentClassDeclaration=false
doubleIndentConstructorArguments=true
doubleIndentMethodDeclaration=true
firstArgumentOnNewline=Force
firstParameterOnNewline=Force
#formatXml=true
#indentLocalDefs=false
#indentPackageBlocks=true
#indentSpaces=2
#indentWithTabs=false
#multilineScaladocCommentsStartOnFirstLine=false
#newlineAtEndOfFile=false
#placeScaladocAsterisksBeneathSecondAsterisk=false
#preserveSpaceBeforeArguments=false
#rewriteArrowSymbols=false
singleCasePatternOnNewline=false
#spaceBeforeColon=false
#spaceBeforeContextColon=false
#spaceInsideBrackets=false
#spaceInsideParentheses=false
#spacesAroundMultiImports=true
#spacesWithinPatternBinders=true

View File

@ -1,8 +1,5 @@
import org.bigbluebutton.build._
import scalariform.formatter.preferences._
import com.typesafe.sbt.SbtScalariform
import com.typesafe.sbt.SbtScalariform.ScalariformKeys
import NativePackagerHelper._
import com.typesafe.sbt.SbtNativePackager.autoImport._
@ -45,12 +42,9 @@ retrieveManaged := true
Seq(Revolver.settings: _*)
lazy val bbbAppsAkka = (project in file(".")).settings(name := "bbb-apps-akka", libraryDependencies ++= Dependencies.runtime).settings(compileSettings)
scalariformAutoformat := false
scalariformPreferences := scalariformPreferences.value
.setPreference(AlignSingleLineCaseStatements, true)
.setPreference(DoubleIndentConstructorArguments, true)
.setPreference(AlignParameters, true)
// See https://github.com/scala-ide/scalariform
// Config file is in ./.scalariform.conf
scalariformAutoformat := true
//-----------
// Packaging

View File

@ -20,14 +20,16 @@ object AppsRedisSubscriberActor extends RedisSubscriber {
classOf[AppsRedisSubscriberActor],
system, jsonMsgBus,
redisHost, redisPort,
channels, patterns).withDispatcher("akka.redis-subscriber-worker-dispatcher")
channels, patterns
).withDispatcher("akka.redis-subscriber-worker-dispatcher")
}
class AppsRedisSubscriberActor(
system: ActorSystem,
msgBus: IncomingJsonMessageBus, redisHost: String,
redisPort: Int,
channels: Seq[String] = Nil, patterns: Seq[String] = Nil)
system: ActorSystem,
msgBus: IncomingJsonMessageBus, redisHost: String,
redisPort: Int,
channels: Seq[String] = Nil, patterns: Seq[String] = Nil
)
extends RedisSubscriberProvider(system, "BbbTranscodeAkkaSub", channels, patterns, msgBus) with SystemConfiguration {
var lastPongReceivedOn = 0L

View File

@ -16,7 +16,7 @@ object JsonMsgHdlrActor {
}
class JsonMsgHdlrActor(val inGW: TranscodingInGW) extends Actor with ActorLogging
with SystemConfiguration with JsonMsgDeserializer {
with SystemConfiguration with JsonMsgDeserializer {
def receive = {
case msg: ReceivedJsonMessage =>
log.debug("handling {} - {}", msg.channel, msg.data)

View File

@ -8,14 +8,13 @@ import org.bigbluebutton.common2.msgs._
import org.bigbluebutton.common2.util.JsonUtil
import org.bigbluebutton.common2.redis.MessageSender
object MessageSenderActor {
def props(msgSender: MessageSender): Props =
Props(classOf[MessageSenderActor], msgSender)
}
class MessageSenderActor(val msgSender: MessageSender)
extends Actor with ActorLogging {
extends Actor with ActorLogging {
val fromBbbTranscodeRedisChannel = "bigbluebutton:from-bbb-transcode:system"
val routing = collection.immutable.HashMap("sender" -> "bbb-transcode")

View File

@ -13,7 +13,7 @@ object TranscodingActor extends SystemConfiguration {
}
class TranscodingActor(val system: ActorSystem, messageSender: MessageSender)
extends Actor with ActorLogging with TranscodingObserverApp {
extends Actor with ActorLogging with TranscodingObserverApp {
val transcodersModel = new TranscodersModel()
val messageSenderActor = context.actorOf(MessageSenderActor.props(messageSender), "bbb-sender-actor")