Navigation Menu

Skip to content

Commit

Permalink
update for Channels
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudshift committed Mar 13, 2012
1 parent dc63dfe commit 94ed9a5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cloudshift/channel/SinkImpl.hx
Expand Up @@ -67,7 +67,7 @@ class SinkImpl implements Sink {
chan<T>(pID):Chan<T> {
var ch = _chans.get(pID) ;
if (ch == null) {
ch = new PipeImpl<T>(pID);
ch = new ChanImpl<T>(pID);
_chans.set(pID,ch);
if (_myfill != null) {
ch._fill = _myfill;
Expand Down
4 changes: 2 additions & 2 deletions usage/chat/ChatClient.hx
Expand Up @@ -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);
Expand Down
7 changes: 4 additions & 3 deletions usage/chat/ChatServer.hx
Expand Up @@ -42,7 +42,6 @@ class ChatServer {
}

function sessAuth(event:ESessionOp) {
trace("authing");
switch(event) {
case Login(pkt,reply):
trace("logging in with "+pkt);
Expand Down Expand Up @@ -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):
Expand All @@ -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"));
}
});
*/
});
}

Expand Down

0 comments on commit 94ed9a5

Please sign in to comment.