0.0
No commit activity in last 3 years
No release in over 3 years
dynarex-events
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0.10.6, ~> 0.10
>= 0.9.2, ~> 0.9
 Project Readme

Introducing the Dynarex-events gem

require 'dynarex-events'

s =<<EOF
<?dynarex schema="entries[title,tags]/entry(date,title,reminder,recurring)"?>
title: Future events
tags: events calendar dates appointments schedule
--+

date: 25-Nov@0930
title: building1
reminder:
recurring: every 2 weeks

date: 25-Nov@2240
title: testing5
reminder: 1 hour before

date: 25-Nov@0930
title: Meeting with Christine in building 44

date: 25-Nov@1000
title: check widget x102

date: 25-Nov@1936
title: Meeting with Julie (not real name) at Cafe X

date: 26-Nov@0600
title: Walking up the Pentland Hills 
EOF

d = Dynarex.new
d.import(s)
de = DynarexEvents.new(d, sps_address: '192.168.4.170', sps_port: '59000') 
de.start

The above example runs a scheduler with the dates provided, and when the time or reminder time matches the current time then an event message is published to the SimplePubSub broker. If the time was now 7:36pm on the 25th Nov the topic 'event' with the message 'Meeting with Julie (not real name) at Cafe X' would be published.

Note: It is expected the reminder should be set as a duration countdown rather than a date (e.g. 1 hour before).

Resources

gem dynarexevents simplepubsub cron