Skip to content

PubSub typesafe abstraction on top of akka DistributedPubSubMediator

License

Notifications You must be signed in to change notification settings

evolution-gaming/pubsub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PubSub

Build Status Coverage Status Codacy Badge Version License: MIT

The library is based on cats-effect 3 since 7.0.0 version, for cats-effect 2.x.x back ports use series/6.x.x

Typesafe layer for DistributedPubSubMediator

trait PubSub[F[_]] {

  def publish[A: Topic : ToBytes](
    msg: A,
    sender: Option[ActorRef] = None,
    sendToEachGroup: Boolean = false
  ): F[Unit]

  def subscribe[A: Topic : FromBytes : ClassTag](
    group: Option[String] = None)(
    onMsg: OnMsg[F, A]
  ): Resource[F, Unit]

  def topics(timeout: FiniteDuration = 3.seconds): F[Set[String]]
}

Ability to serialize/deserialize messages to offload akka remoting and improve throughput

Check DistributedPubSubMediatorSerializing.scala

Setup

addSbtPlugin("com.evolution" % "sbt-artifactory-plugin" % "0.0.2")

libraryDependencies += "com.evolutiongaming" %% "pubsub" % "7.0.0"

CHANGELOG

7.0.0

Upgrades
  • cats-effect 2.5.4 to 3.3.11