I think I resolved the coffeescript class structure problem
This commit is contained in:
parent
1ccc24d71c
commit
22a31392f4
11
labs/meteor-client/server/app.coffee
Normal file
11
labs/meteor-client/server/app.coffee
Normal 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()
|
7
labs/meteor-client/server/clientproxy.coffee
Normal file
7
labs/meteor-client/server/clientproxy.coffee
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
class Meteor.ClientProxy
|
||||||
|
constructor: ->
|
||||||
|
console.log "initializing ClientProxy"
|
||||||
|
bbb: ->
|
||||||
|
console.log "bbb ClientProxy"
|
||||||
|
console.log "CLIENT PROXY"
|
@ -1,30 +1,5 @@
|
|||||||
if Meteor.isServer
|
class Meteor.RedisPubSub
|
||||||
console.log " I am in the server"
|
constructor: ->
|
||||||
Meteor.startup ->
|
console.log "initializing RedisPubSub"
|
||||||
console.log "On startup in the server"
|
bbb: ->
|
||||||
console.log Meteor.config.appName
|
console.log "bbb RedisPubSub"
|
||||||
|
|
||||||
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"
|
|
||||||
|
Loading…
Reference in New Issue
Block a user