Skip to content

Instantly share code, notes, and snippets.

@tzachz
Created July 25, 2022 17:25
Show Gist options
  • Save tzachz/734768ef91ee17ac3a9008de50d5299b to your computer and use it in GitHub Desktop.
Save tzachz/734768ef91ee17ac3a9008de50d5299b to your computer and use it in GitHub Desktop.
Beating Conway’s Law: Achieving Distributed Ownership with Guice, RabbitMQ and Kubernetes - code snippet 3
@Singleton
class PublisherRegistry @Inject()(publishers: Seq[Publisher]) {
def getPublisher(publisherType: PublisherType): Publisher = publishers
.find(_.publisherType == publisherType)
.getOrElse(failGracefully(publisherType))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment