Sha256: 0207a2bee78309e228594a2b614710de17b69bd9e0213ad69edcd3dc3968ece0

Contents?: true

Size: 1.75 KB

Versions: 22

Compression:

Stored size: 1.75 KB

Contents

module BBK
  module App
    class Dispatcher

      ANSWER_DOMAIN: 'answer'

      interface _Consumer
        def stop: () -> void
      end

      interface _Publisher
        def publish: (Result) -> untyped # Concurrent::Promises::ResolvableFuture
        def close: () -> void
      end

      interface _Middleware
        def call: (_Message) -> Array[Result]
      end

      interface _MiddlewareClass
        def new: (untyped) -> _Middleware
      end

      interface _MiddlewareBuilder
        def build: (untyped) -> _Middleware
      end

      interface _ProcessorsStack
        def call: (_Message) -> Array[Result]
      end

      interface _PoolFactory
        def call: (Integer pool_size, Integer queue_size) -> untyped
      end

      type logger = BBK::Utils::_ProxyObject|_Logger

      attr_accessor force_quit: bool
      attr_reader consumers: Array[_Consumer]
      attr_reader publishers: Array[_Publisher]
      attr_reader middlewares: Array[_MiddlewareBuilder|_MiddlewareClass]
      attr_reader logger: logger

      def initialize: (Handler, ?pool_size: Integer, ?logger: logger, ?pool_factory: _PoolFactory, ?stream_strategy: StreamStrategyClass) -> void
      def register_consumer: (_Consumer) -> void
      def register_publisher: (_Publisher) -> void
      def register_middleware: (_MiddlewareBuilder|_MiddlewareClass) -> void
      def run: () -> void
      def close: (?Integer time) -> void

      private

      def process: (_Message) -> void
      def process_message: (_Message) -> Array[Result]
      def find_processor: (_Message) -> [untyped, _Processor]
      def build_processing_stack: () -> _ProcessorsStack
      def send_results: (_Message, Array[untyped]) -> void
      def publish_result: (Result) -> untyped

    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
bbk-app-1.1.1.273627 sig/bbk/app/dispatcher.rbs
bbk-app-1.1.1.273338 sig/bbk/app/dispatcher.rbs
bbk-app-1.1.1.273312 sig/bbk/app/dispatcher.rbs
bbk-app-1.1.1.273294 sig/bbk/app/dispatcher.rbs
bbk-app-1.1.0.219406 sig/bbk/app/dispatcher.rbs
bbk-app-1.1.0.216998 sig/bbk/app/dispatcher.rbs
bbk-app-1.1.0.204569 sig/bbk/app/dispatcher.rbs
bbk-app-1.1.0.200751 sig/bbk/app/dispatcher.rbs
bbk-app-1.1.0.200186 sig/bbk/app/dispatcher.rbs
bbk-app-1.1.0.199675 sig/bbk/app/dispatcher.rbs
bbk-app-1.1.0.199604 sig/bbk/app/dispatcher.rbs
bbk-app-1.1.0.199389 sig/bbk/app/dispatcher.rbs
bbk-app-1.1.0.199383 sig/bbk/app/dispatcher.rbs
bbk-app-1.0.0.152254 sig/bbk/app/dispatcher.rbs
bbk-app-1.0.0.141716 sig/bbk/app/dispatcher.rbs
bbk-app-1.0.0.80957 sig/bbk/app/dispatcher.rbs
bbk-app-1.0.0.79514 sig/bbk/app/dispatcher.rbs
bbk-app-1.0.0.79241 sig/bbk/app/dispatcher.rbs
bbk-app-1.0.0.78020 sig/bbk/app/dispatcher.rbs
bbk-app-1.0.0.72920 sig/bbk/app/dispatcher.rbs