Shard Detail

harold v0.5.0

harold - crystal library for in-process pub-sub communication.

Install & Use

Add the following code to your project's shard.yml under:

dependencies to use in production
- OR -
development_dependencies to use in development


harold:
  github: waterlink/harold

Readme

harold

harold - crystal library for inter-process pub-sub communication.

Installation

Add this to your application's shard.yml:

dependencies:
  harold:
    github: waterlink/harold

Usage

require "harold"

Harold.start

Publishing

Harold.publish(topic :: String, "message")

NOTE: topic is expected to be a valid crystal identifier.

NOTE: :: {{Type}} part after topic name is the type annotation for message.

Subscribing

spawn do
  Harold.subscribe(topic :: String).each do |message|
    puts "Someone said: #{message}"
  end
end

NOTE: topic is expected to be a valid crystal identifier.

NOTE: :: {{Type}} part after topic name is the type annotation for message.

Development

After cloning the project:

  • Use crystal deps or shards to install development dependencies.
  • Use crystal spec to run tests.
  • Use TDD.

Contributing

  1. Fork it ( https://github.com/waterlink/harold/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • waterlink Oleksii Fedorov - creator, maintainer