From 94ed9a579bd1f1f063dde43c8d22644b807478d7 Mon Sep 17 00:00:00 2001 From: ritchie Date: Mon, 12 Mar 2012 21:51:48 -0300 Subject: [PATCH] update for Channels --- cloudshift/channel/SinkImpl.hx | 2 +- usage/chat/ChatClient.hx | 4 ++-- usage/chat/ChatServer.hx | 7 ++++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/cloudshift/channel/SinkImpl.hx b/cloudshift/channel/SinkImpl.hx index d4c87e3..e5f7bdb 100644 --- a/cloudshift/channel/SinkImpl.hx +++ b/cloudshift/channel/SinkImpl.hx @@ -67,7 +67,7 @@ class SinkImpl implements Sink { chan(pID):Chan { var ch = _chans.get(pID) ; if (ch == null) { - ch = new PipeImpl(pID); + ch = new ChanImpl(pID); _chans.set(pID,ch); if (_myfill != null) { ch._fill = _myfill; diff --git a/usage/chat/ChatClient.hx b/usage/chat/ChatClient.hx index 135058f..ff4fd9e 100644 --- a/usage/chat/ChatClient.hx +++ b/usage/chat/ChatClient.hx @@ -49,9 +49,9 @@ class ChatClient { ChatUi.status("authorized in room"); ChatUi.setChat(function(msg) { trace("should be sending "+msg); - room.fill(Chat(nick,msg)); + room.pub(Chat(nick,msg)); }); - room.drain(function(mt:MsgTypes) { + room.sub(function(mt:MsgTypes) { switch(mt) { case Chat(nick,msg): ChatUi.msg(nick,msg); diff --git a/usage/chat/ChatServer.hx b/usage/chat/ChatServer.hx index 1f494da..a24cd97 100644 --- a/usage/chat/ChatServer.hx +++ b/usage/chat/ChatServer.hx @@ -42,7 +42,6 @@ class ChatServer { } function sessAuth(event:ESessionOp) { - trace("authing"); switch(event) { case Login(pkt,reply): trace("logging in with "+pkt); @@ -78,6 +77,7 @@ class ChatServer { Core.listParts(); cs.channel("/chat/room").outcome(function(room) { trace("added rooms"); + /* room.filter(function(o) { switch(o) { case Chat(nick,msg): @@ -90,11 +90,12 @@ class ChatServer { room.peek(function(pe) { switch(pe) { case Add(i): - room.fill(Chat("bot","someone entered")); + room.pub(Chat("bot","someone entered")); case Del(i): - room.fill(Chat("bot","someone left")); + room.pub(Chat("bot","someone left")); } }); + */ }); }