Class PubSub

  • All Implemented Interfaces:
    Extension

    public final class PubSub
    extends java.lang.Object
    implements Extension
    • Constructor Summary

      Constructors 
      Constructor Description
      PubSub​(ActorSystem<?> system)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static T apply​(ActorSystem<?> system)  
      static PubSub createExtension​(ActorSystem<?> system)  
      scala.collection.immutable.Set<java.lang.String> currentTopics()
      Scala API: return the current set of running topics
      static boolean equals​(java.lang.Object other)  
      static PubSub get​(ActorSystem<?> system)  
      java.util.Set<java.lang.String> getCurrentTopics()
      Java API: return the current set of running topics
      static int hashCode()  
      static ExtensionId<T> id()  
      <T> ActorRef<Topic.Command<T>> topic​(java.lang.Class<T> messageClass, java.lang.String name)
      Java API: Spawn an actor with the given topic name or share an existing one if it is already running.
      <T> ActorRef<Topic.Command<T>> topic​(java.lang.Class<T> messageClass, java.lang.String name, java.time.Duration ttl)
      Scala API: Spawn an actor with the given topic name or share an existing one if it is already running.
      <T> ActorRef<Topic.Command<T>> topic​(java.lang.String name, scala.concurrent.duration.FiniteDuration ttl, scala.reflect.ClassTag<T> classTag)
      Scala API: Spawn an actor with the given topic name or share an existing one if it is already running.
      <T> ActorRef<Topic.Command<T>> topic​(java.lang.String name, scala.reflect.ClassTag<T> classTag)
      Scala API: Spawn an actor with the given topic name or share an existing one if it is already running.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • apply

        public static final T apply​(ActorSystem<?> system)
      • hashCode

        public static final int hashCode()
      • equals

        public static final boolean equals​(java.lang.Object other)
      • topic

        public <T> ActorRef<Topic.Command<T>> topic​(java.lang.String name,
                                                    scala.reflect.ClassTag<T> classTag)
        Scala API: Spawn an actor with the given topic name or share an existing one if it is already running.

        Note that Topic actors manually started will not be part of this registry.

      • topic

        public <T> ActorRef<Topic.Command<T>> topic​(java.lang.String name,
                                                    scala.concurrent.duration.FiniteDuration ttl,
                                                    scala.reflect.ClassTag<T> classTag)
        Scala API: Spawn an actor with the given topic name or share an existing one if it is already running.

        Note that Topic actors manually started will not be part of this registry.

        Parameters:
        ttl - If the topic is idle this long, shut the actor down. All calls to topic for the same topic name should use the same ttl.
      • topic

        public <T> ActorRef<Topic.Command<T>> topic​(java.lang.Class<T> messageClass,
                                                    java.lang.String name)
        Java API: Spawn an actor with the given topic name or share an existing one if it is already running.

        Note that Topic actors manually started will not be part of this registry.

        Parameters:
        messageClass - the type of messages the topic accepts for publishing and subscribing
      • topic

        public <T> ActorRef<Topic.Command<T>> topic​(java.lang.Class<T> messageClass,
                                                    java.lang.String name,
                                                    java.time.Duration ttl)
        Scala API: Spawn an actor with the given topic name or share an existing one if it is already running.

        Note that Topic actors manually started will not be part of this registry.

        Parameters:
        ttl - If the topic is idle this long, shut the actor down. All calls to topic for the same topic name should use the same ttl.
      • currentTopics

        public scala.collection.immutable.Set<java.lang.String> currentTopics()
        Scala API: return the current set of running topics
      • getCurrentTopics

        public java.util.Set<java.lang.String> getCurrentTopics()
        Java API: return the current set of running topics