Packages

  • package root
    Definition Classes
    root
  • package csw
    Definition Classes
    root
  • package event
    Definition Classes
    csw
  • package client

    This module implements an Event Service responsible for publishing an csw.params.events.Event or subscribing to an csw.params.events.Event.

    Event Service

    This module implements an Event Service responsible for publishing an csw.params.events.Event or subscribing to an csw.params.events.Event. An event is published on a csw.params.events.EventKey. The event key is composed of a csw.prefix.models.Prefix depicting the source and an csw.params.events.EventName. The subscriber can subscribe to the csw.params.events.EventKey to receive all events published on the Key.

    Example: Event Service
    val eventServiceFactory          = new EventServiceFactory()
    val eventService: EventService   = eventServiceFactory.make(locationService)

    Using above code, you can create instance of csw.event.api.scaladsl.EventService. EventService is the factory to create publishers and subscribers.

    You can choose to use defaultPublisher in case you want to share same connection for publishing different events.

    Example: Event Publisher

    Event Publisher provides asynchronous APIs to publish one or more Events

    val event = SystemEvent(prefix, EventName("filter_wheel"))
    
    val publisher    = eventService.defaultPublisher
    publisher.publish(event)
    Example: Event Subscriber (subscribe and get API)

    Event Subscriber provides asynchronous APIs to subscribe to one or more Event Keys. It also provides APIs to subscribe using a pattern. In addition, there are APIs to get latest events for one ore more Event Keys without making a subscription

    The EventSubscriber provides various API's to subscribe to csw.params.events.EventKey. One of such a subscribe method takes an ActorRef of an arbitrary actor or a callback function to be called when an event matching the given csw.params.events.EventKey is received. In the example below, we only provide the callback argument value. You could also provide an ActorRef of some actor that should receive the Event message.

     def callback(ev: Event): Unit = {
       // ...
     }
    
     async {
       val subscriber    = eventService.defaultSubscriber
       subscriber.subscribeCallback(Set(EventKey(prefix, EventName("filter_wheel"))), callback)
    
       val event = await(subscriber.get(event.eventKey))
    
       event match {
         case e: ObserveEvent => assert(e.prefix == expectedPrefix)
         case _               => fail("Expected ObserveEvent")
       }
    }

    csw provides two implementations for Event Service which can be accessed through csw-event-client : 1. RedisEventService - Redis as event store and publisher/subscriber functionality 2. KafkaEventService - Kafka as event store and publisher/subscriber functionality

    Complete guide of usage of different API's provided by EventService is available at: https://tmtsoftware.github.io/csw/services/event.html

    Definition Classes
    event
  • package internal
    Definition Classes
    client
  • package models
    Definition Classes
    client
  • package utils
    Definition Classes
    client
  • EventServiceFactory
c

csw.event.client

EventServiceFactory

class EventServiceFactory extends AnyRef

Factory to create EventService

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. EventServiceFactory
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new EventServiceFactory()

    A java helper to construct EventServiceFactory

  2. new EventServiceFactory(store: EventStore = RedisStore())

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  8. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  9. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  10. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  11. def jMake(host: String, port: Int, system: ActorSystem[_]): IEventService

    Java API to create csw.event.api.javadsl.IEventService using host and port of Event Server.

    Java API to create csw.event.api.javadsl.IEventService using host and port of Event Server.

    host

    hostname of event server

    port

    port on which event server is running

    system

    an actor system required for underlying event streams

    returns

    csw.event.api.javadsl.IEventService which provides handles to csw.event.api.javadsl.IEventPublisher and csw.event.api.javadsl.IEventSubscriber

  12. def jMake(locationService: ILocationService, actorSystem: ActorSystem[_]): IEventService

    Java API to create csw.event.api.javadsl.IEventService using csw.location.api.javadsl.ILocationService to resolve Event Server.

    Java API to create csw.event.api.javadsl.IEventService using csw.location.api.javadsl.ILocationService to resolve Event Server.

    locationService

    instance of location service

    actorSystem

    an actor system required for underlying event streams

    returns

    csw.event.api.javadsl.IEventService which provides handles to csw.event.api.javadsl.IEventPublisher and csw.event.api.javadsl.IEventSubscriber

  13. def make(host: String, port: Int)(implicit system: ActorSystem[_]): EventService

    API to create csw.event.api.scaladsl.EventService using host and port of Event Server.

    API to create csw.event.api.scaladsl.EventService using host and port of Event Server.

    host

    hostname of event server

    port

    port on which event server is running

    system

    an actor system required for underlying event streams

    returns

    csw.event.api.scaladsl.EventService which provides handles to csw.event.api.scaladsl.EventPublisher and csw.event.api.scaladsl.EventSubscriber

  14. def make(locationService: LocationService)(implicit system: ActorSystem[_]): EventService

    API to create csw.event.api.scaladsl.EventService using csw.location.api.scaladsl.LocationService to resolve Event Server.

    locationService

    instance of location service

    system

    an actor system required for underlying event streams

    returns

    csw.event.api.scaladsl.EventService which provides handles to csw.event.api.scaladsl.EventPublisher and csw.event.api.scaladsl.EventSubscriber

  15. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  17. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  18. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  19. def toString(): String
    Definition Classes
    AnyRef → Any
  20. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  21. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  22. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped