Class: Chasqui::Config

Inherits:
Struct
  • Object
show all
Defined in:
lib/chasqui/config.rb

Overview

Stores and manages all Chasqui configuration settings.

Instance Attribute Summary collapse

Instance Attribute Details

#broker_poll_intervalFixnum

How long the broker daemon waits for an event before pausing to handle signals. Default: 3

Returns:

  • (Fixnum)

    seconds



# File 'lib/chasqui/config.rb', line 22

#channel_prefixString

A string to prepend to channel names for all published events. This is useful for namespacing channel names to prevent collisions with other applications that may choose the same channel name for a different type of event. Default: nil

Examples:

Chasqui.configure do |c|
  c.channel_prefix = 'com.example.app1'
end

# publishes to channel: "com.example.app1.user.signup"
Chasqui.publish 'user.signup', user

Returns:

  • (String)


# File 'lib/chasqui/config.rb', line 27

#default_queueString

The queue to use when a worker class does not define a queue and a queue option is not supplied to #on. Default: “chasqui-workers”

Returns:

  • (String)


# File 'lib/chasqui/config.rb', line 43

#inbox_queueString

The queue that stores published events until they are delivered to subscriber (worker) queues. Default: “chasqui-inbox”

Returns:

  • (String)


# File 'lib/chasqui/config.rb', line 49

#loggerLogger

The logger to use for the Chasqui broker. Default: Logger.new(STDOUT)

Returns:

  • (Logger)


# File 'lib/chasqui/config.rb', line 54

#queue_adapterChasqui::QueueAdapter

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The queue adapter to use for binding queues to channels.



# File 'lib/chasqui/config.rb', line 58

#redisRedis, ...

Customize the Redis databse connection Chasqui uses. Default: “redis://localhost:6379/0”

Returns:

  • (Redis, String, Hash)


# File 'lib/chasqui/config.rb', line 63

#worker_backendSymbol

The type of worker that will handle events in class to Chasqui.subscribe. Can be either resque or sidekiq. Chasqui will attempt to auto-detect the worker_backend if either library is loaded. Default: nil

Returns:

  • (Symbol)


# File 'lib/chasqui/config.rb', line 68