harold
harold
harold - crystal library for in-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
orshards
to install development dependencies. - Use
crystal spec
to run tests. - Use TDD.
Contributing
- Fork it ( https://github.com/waterlink/harold/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- waterlink Oleksii Fedorov - creator, maintainer
Repository
harold
Owner
Statistic
- 0
- 1
- 0
- 0
- 1
- about 9 years ago
- October 24, 2015
License
MIT License
Links
Synced at
Wed, 06 Nov 2024 23:37:52 GMT
Languages