Module: Polyn

Defined in:
lib/polyn.rb,
lib/polyn/nats.rb,
lib/polyn/event.rb,
lib/polyn/naming.rb,
lib/polyn/testing.rb,
lib/polyn/tracing.rb,
lib/polyn/version.rb,
lib/polyn/nats/msg.rb,
lib/polyn/utils/hash.rb,
lib/polyn/cloud_event.rb,
lib/polyn/errors/error.rb,
lib/polyn/schema_store.rb,
lib/polyn/utils/string.rb,
lib/polyn/configuration.rb,
lib/polyn/pull_subscriber.rb,
lib/polyn/serializers/json.rb,
lib/polyn/testing/mock_msg.rb,
lib/polyn/testing/mock_nats.rb,
lib/polyn/errors/schema_error.rb,
lib/polyn/testing/mock_jetstream.rb,
lib/polyn/errors/validation_error.rb,
lib/polyn/errors/configuration_error.rb,
lib/polyn/testing/mock_pull_subscription.rb

Overview

Copyright 2021-2022 Spiff, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Defined Under Namespace

Modules: Errors, Serializers, Utils Classes: CloudEvent, Configuration, Conn, Event, Naming, Nats, PullSubscriber, SchemaStore, Testing, Tracing

Constant Summary collapse

VERSION =
"0.4.0"

Class Method Summary collapse

Class Method Details

.configurationObject

Configuration information for Polyn



48
49
50
# File 'lib/polyn.rb', line 48

def self.configuration
  @configuration ||= Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Configuration block to configure Polyn

Yields:



54
55
56
# File 'lib/polyn.rb', line 54

def self.configure
  yield(configuration)
end

.connect(nats, **opts) ⇒ Object

Connects Polyn to a NATS connection and loads all event schemas

Parameters:

  • nats (NATS::IO::Client)

    A nats connection instance



62
63
64
# File 'lib/polyn.rb', line 62

def self.connect(nats, **opts)
  Conn.new(nats, **opts)
end