Permalink
Browse files

small tweaks

  • Loading branch information...
cloudshift committed Mar 14, 2012
1 parent 04e5a55 commit c889221aae609a016652818ccbf7a899e35ae6d0
View
@@ -86,7 +86,7 @@ interface ChannelClient
implements ChannelProvider,
implements Part<String,ChannelClientError,ChannelClient,ESession> {
- function unsub(chan:Chan<Dynamic>):Void;
+ // function unsub(chan:Chan<Dynamic>):Void;
function channel<T>(id:String):Outcome<String,Chan<T>>;
function direct<T>(sessID:String):Outcome<String,Chan<T>>;
}
View
@@ -57,7 +57,7 @@ enum SinkEvent {
ConnectionClose(sessID:String);
}
- interface Sink implements Part<Conduit,String,Sink,SinkEvent> {
+interface Sink implements Part<Conduit,String,Sink,SinkEvent> {
function chan<T>(chanID:String):Chan<T>;
function addConduit(conduit:Conduit):Void ;
function chanFromId(chanID:String):Option<Chan<Dynamic>>;
@@ -84,15 +84,6 @@ class Flow {
return pl;
}
-
- /*
- public static function
- quickFlow() {
- return new cloudshift.channel.QuickFlowImpl();
- }
- */
-
-
#elseif CS_BROWSER
public static function
@@ -156,12 +156,12 @@ class PushListenerImpl implements Conduit {
public function
pump(sessID:String,payload:Dynamic,chanID:String,meta:Dynamic) {
- _sessions.get(sessID).append(Flow.createPkt(payload,sessID,chanID,meta));
+ _sessions.get(sessID).append(Channel.createPkt(payload,sessID,chanID,meta));
}
public function
direct(sessID:String,payload:Dynamic) {
- _sessions.get(sessID).append(Flow.createPkt(payload,sessID,"/__cs/direct"));
+ _sessions.get(sessID).append(Channel.createPkt(payload,sessID,Core.CSROOT+"direct"));
}
public function
@@ -55,17 +55,11 @@ class TChannelClient implements ChannelClient,
public function
channel<T>(id:String):Outcome<String,Chan<T>> {
- var oc = Core.outcome();
- _sink.authorize(_sink.chan(id)).outcome(function(val) {
- oc.resolve(Right(val));
- });
- return oc;
+ return _sink.authorize(_sink.chan(id));
}
public function direct<T>(sessID:String):Outcome<String,Chan<T>> {
- var oc = Core.outcome();
- _sink.authorize(_sink.chan(sessID)).deliver(cast oc.resolve);
- return oc;
+ return _sink.authorize(_sink.chan(sessID));
}
public function unsub(chan:Chan<Dynamic>) {

0 comments on commit c889221

Please sign in to comment.