https://github.com/evolution-gaming/pubsub
PubSub typesafe abstraction on top of akka DistributedPubSubMediator
https://github.com/evolution-gaming/pubsub
akka cluster pubsub
Last synced: about 1 year ago
JSON representation
PubSub typesafe abstraction on top of akka DistributedPubSubMediator
- Host: GitHub
- URL: https://github.com/evolution-gaming/pubsub
- Owner: evolution-gaming
- License: mit
- Created: 2017-11-26T09:54:46.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-08-12T13:54:39.000Z (almost 2 years ago)
- Last Synced: 2025-04-23T00:15:55.164Z (about 1 year ago)
- Topics: akka, cluster, pubsub
- Language: Scala
- Size: 224 KB
- Stars: 3
- Watchers: 10
- Forks: 2
- Open Issues: 37
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PubSub
[](https://github.com/evolution-gaming/pubsub/actions?query=workflow%3ACI)
[](https://coveralls.io/github/evolution-gaming/pubsub?branch=master)
[](https://www.codacy.com/app/evolution-gaming/pubsub?utm_source=github.com&utm_medium=referral&utm_content=evolution-gaming/pubsub&utm_campaign=Badge_Grade)
[](https://evolution.jfrog.io/artifactory/api/search/latestVersion?g=com.evolutiongaming&a=pubsub_2.13&repos=public)
[](https://opensource.org/licenses/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](https://github.com/evolution-gaming/pubsub/tree/series/6.x.x)
### Typesafe layer for DistributedPubSubMediator
```scala
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
```scala
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