forked from YACS-RCOS/yacs-notifications
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolved issue YACS-RCOS#7 & YACS-RCOS#8
- Loading branch information
Showing
4 changed files
with
17 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,23 @@ | ||
require 'plezi' | ||
require 'iodine' | ||
require 'json' | ||
|
||
class EventStream | ||
|
||
#@auto_dispatch = true | ||
|
||
def on_open | ||
puts 'Opened the YACS-EventStream Websocket!' | ||
end | ||
|
||
## When receiving a single message from Consumer pusblish to socket | ||
def on_message(data) | ||
event = {:notifications => :data } | ||
write event.to_json | ||
#def on_message data | ||
def notify(data) | ||
puts data | ||
#event = {:notifications => data } | ||
#puts event.to_json # need to figure out this shit | ||
end | ||
|
||
def on_close | ||
end | ||
end | ||
Plezi.route '/notifications', EventStream | ||
#Plezi.route '/notifications', EventStream | ||
#ip address 172.19.0.9:9094 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters