I think I resolved the coffeescript class structure problem

This commit is contained in:
Anton Georgiev 2014-06-11 17:56:07 +00:00
parent 1ccc24d71c
commit 22a31392f4
3 changed files with 23 additions and 30 deletions

View File

@ -0,0 +1,11 @@
if Meteor.isServer
console.log " I am in the server"
Meteor.startup ->
console.log "On startup in the server"
console.log Meteor.config.appName
a = new Meteor.ClientProxy()
b = new Meteor.RedisPubSub()

View File

@ -0,0 +1,7 @@
class Meteor.ClientProxy
constructor: ->
console.log "initializing ClientProxy"
bbb: ->
console.log "bbb ClientProxy"
console.log "CLIENT PROXY"

View File

@ -1,30 +1,5 @@
if Meteor.isServer
console.log " I am in the server"
Meteor.startup ->
console.log "On startup in the server"
console.log Meteor.config.appName
pubClient = redis.createClient()
subClient = redis.createClient()
subClient.on "psubscribe", _onSubscribe
subClient.on "pmessage", _onMessage
console.log("RPC: Subscribing message on channel: #{Meteor.config.redis.channels.fromBBBApps}")
subClient.psubscribe(Meteor.config.redis.channels.fromBBBApps)
_onMessage = () ->
console.log "ON MESSAGE"
_onSubscribe = () ->
console.log "ON SUBSCRIBE"
class Meteor.RedisPubSub
constructor: ->
console.log "initializing RedisPubSub"
bbb: ->
console.log "bbb RedisPubSub"