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:

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