Skip to content

Commit

Permalink
Flow is now the internal api
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudshift committed Mar 12, 2012
1 parent 9c7aaf0 commit 2020726
Show file tree
Hide file tree
Showing 13 changed files with 56 additions and 106 deletions.
40 changes: 40 additions & 0 deletions cloudshift/Channel.hx
Expand Up @@ -108,4 +108,44 @@ class Channel {
return new cloudshift.channel.TChannelClient();
}
#end

public static function
chanID(pkt:Pkt<Dynamic>) {
return pkt.m.ch;
}

public static function
operation(pkt:Pkt<Dynamic>) {
return pkt.m.op;
}

public static function
payload(pkt:Pkt<Dynamic>) {
return pkt.p;
}

public static function
setPayload(pkt:Pkt<Dynamic>,pl:Dynamic) {
pkt.p = pl;
}

public static function
sessID(pkt:Pkt<Dynamic>) {
return pkt.s;
}

public static function oldmeta(pkt:Pkt<Dynamic>) {
return pkt.m;
}

public static function meta(pkt:Pkt<Dynamic>):Dynamic {
return pkt.m.um;
}

public static function
createPkt<T>(userData:T,sessID:String,chan:String,op="m",meta:Dynamic=null):Pkt<T> {
return { p:userData,s:sessID,m:{ch:chan,op:op,um:meta} };
}


}
1 change: 0 additions & 1 deletion cloudshift/channel/ClientSinkImpl.hx
Expand Up @@ -5,7 +5,6 @@ import cloudshift.Core;
import cloudshift.Session;
import cloudshift.Channel;
import cloudshift.channel.Flow;
import cloudshift.channel.InternalApi;


class ClientSinkImpl extends SinkImpl {
Expand Down
25 changes: 15 additions & 10 deletions cloudshift/channel/Flow.hx
Expand Up @@ -8,9 +8,23 @@ import cloudshift.Channel;

#if nodejs
import cloudshift.Http;
import cloudshift.channel.InternalApi;
#end

interface MessageQ {
function append(pkt:Dynamic):Void;
function setFlusher(cb:MessageQ->Bool):Void;
function sessID():String;
function deQueue():Array<Dynamic>;
}

interface ConduitSession {
function append(pkt:Dynamic):Void;
function flusher(flush:MessageQ->Bool):Void;
function subscriptions():Hash<Void->Void>;
function shutDown():Void;
var lastConnection(default,default):Float;
var sessID(default,default):String;
}

typedef ConduitClientStart = {
var host:String;
Expand Down Expand Up @@ -52,15 +66,6 @@ enum SinkEvent {
function direct<T>(sessID:String):Chan<T>;
}


/*
typedef QuickFlow = {
var conduit:Conduit;
var session:SessionMgr;
var sink:Sink;
}
*/

class Flow {

public static var PUSH = Core.CSROOT+"p";
Expand Down
24 changes: 0 additions & 24 deletions cloudshift/channel/InternalApi.hx

This file was deleted.

1 change: 0 additions & 1 deletion cloudshift/channel/MessageQImpl.hx
@@ -1,7 +1,6 @@

package cloudshift.channel;
import cloudshift.channel.Flow;
import cloudshift.channel.InternalApi;

using cloudshift.Mixin;

Expand Down
1 change: 0 additions & 1 deletion cloudshift/channel/PipeImpl.hx
Expand Up @@ -5,7 +5,6 @@ import cloudshift.Core;
using cloudshift.Mixin;
import cloudshift.Channel;
import cloudshift.channel.Flow;
import cloudshift.channel.InternalApi;

using cloudshift.channel.Flow;

Expand Down
1 change: 0 additions & 1 deletion cloudshift/channel/PushClientImpl.hx
Expand Up @@ -6,7 +6,6 @@ import cloudshift.Channel;

import cloudshift.channel.Flow;
import cloudshift.Session;
import cloudshift.channel.InternalApi;
import cloudshift.core.ObservableImpl;
using cloudshift.Mixin;
using cloudshift.channel.Flow;
Expand Down
1 change: 0 additions & 1 deletion cloudshift/channel/PushListenerImpl.hx
Expand Up @@ -7,7 +7,6 @@ import cloudshift.Session;
import cloudshift.Channel;

import cloudshift.channel.Flow;
import cloudshift.channel.InternalApi;
import cloudshift.Http;
import cloudshift.http.HttpImpl;
import cloudshift.core.ObservableImpl;
Expand Down
1 change: 0 additions & 1 deletion cloudshift/channel/PushSessionImpl.hx
Expand Up @@ -3,7 +3,6 @@ package cloudshift.channel;

import cloudshift.Http;
import cloudshift.channel.Flow;
import cloudshift.channel.InternalApi;
import cloudshift.channel.MessageQImpl;

using cloudshift.Mixin;
Expand Down
63 changes: 0 additions & 63 deletions cloudshift/channel/QuickFlowImpl.hx

This file was deleted.

1 change: 0 additions & 1 deletion cloudshift/channel/ServerSinkImpl.hx
Expand Up @@ -6,7 +6,6 @@ import cloudshift.Session;
import cloudshift.Channel;
import cloudshift.channel.Flow;
import cloudshift.Http;
import cloudshift.channel.InternalApi;

using cloudshift.Mixin;

Expand Down
1 change: 0 additions & 1 deletion cloudshift/channel/SinkImpl.hx
Expand Up @@ -4,7 +4,6 @@ package cloudshift.channel;
import cloudshift.Core;
import cloudshift.Channel;
import cloudshift.channel.Flow;
import cloudshift.channel.InternalApi;
import cloudshift.core.ObservableImpl;
using cloudshift.Mixin;

Expand Down
2 changes: 1 addition & 1 deletion cloudshift/channel/TChannelServer.hx
Expand Up @@ -5,8 +5,8 @@ import cloudshift.Core;
import cloudshift.Channel;
import cloudshift.Http;
import cloudshift.Session;
import cloudshift.channel.Flow;
using cloudshift.Mixin;
import cloudshift.channel.Flow;

class TChannelServer implements ChannelServer,implements Part<Dynamic,String,ChannelServer,ChannelEvent> {
public var part_:Part_<Dynamic,String,ChannelServer,ChannelEvent>;
Expand Down

0 comments on commit 2020726

Please sign in to comment.