Created
January 25, 2013 10:04
-
-
Save thebadger412/4633233 to your computer and use it in GitHub Desktop.
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
#### serial rpc module #### | |
ss = require 'socketstream' | |
_ = require 'underscore' | |
dashboardController = ss.api.app.controllers.dashboard | |
Dashboard = ss.api.app.models.Dashboard | |
fetchUserFromSession = ss.api.fetchUserFromSession | |
exports.actions = (req, res, ss) -> | |
req.use 'session' | |
# I'm not going to port this RPC method to the HTTP API for now, I don't think there's much need for that ATM. | |
serial: -> | |
#ss.publish.channel "user_#{user._id}", 'widgetPositionsUpdated', {_id: dashboard._id, positions: data.positions} | |
#ss.publish.channel "user_#{51019b9b821cf8db0d000002}", 'transmission', {_id:"51019fe9357865660e000014", bigNumber: 313} | |
ss.publish.channel("user_<51019b9b821cf8db0d000002>", 'transmission', {_id: "51019fe9357865660e000014", bigNumber: 999}); | |
ss.api.publish.channel("user_<51019b9b821cf8db0d000002>", 'transmission', {_id: "51019fe9357865660e000014", bigNumber: 999}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just a quick one, line 17 will work in an RPC file. Also, You'll need to remove the < and > from "user_<51019b9b821cf8db0d000002>".
Thirdly, how are you calling the 'serial' rpc command? From the browser or from the terminal with ss-console?