Permalink
Browse files

only Channel has packet accessors

  • Loading branch information...
1 parent 2020726 commit a2cad5befa0b26cb5f21a9c8a41638738b7c7339 @cloudshift committed Mar 12, 2012
View
@@ -108,44 +108,6 @@ class Flow {
#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} };
- }
}
@@ -6,7 +6,7 @@ using cloudshift.Mixin;
import cloudshift.Channel;
import cloudshift.channel.Flow;
-using cloudshift.channel.Flow;
+using cloudshift.Channel;
class PipeImpl<T> implements Chan<T> {
@@ -66,7 +66,7 @@ class PushClientImpl implements Conduit {
public function
pump(sessID:String,userData:Dynamic,chanID:String,meta:Dynamic) {
var
- ud = Flow.createPkt(userData,_sessID,chanID,"m",meta),
+ ud = Channel.createPkt(userData,_sessID,chanID,"m",meta),
pl = haxe.Serializer.run(ud),
req = new haxe.Http(_url+Flow.PUSH);
@@ -137,7 +137,7 @@ class PushClientImpl implements Conduit {
function
client(cmd:String,userData:Dynamic,chanID:String,cb:Dynamic->Void) {
var
- ud = Flow.createPkt(userData,_sessID,chanID,cmd),
+ ud = Channel.createPkt(userData,_sessID,chanID,cmd),
pl = haxe.Serializer.run(ud),
req = new haxe.Http(_url+Flow.PUSH);
@@ -11,7 +11,7 @@ import cloudshift.Http;
import cloudshift.http.HttpImpl;
import cloudshift.core.ObservableImpl;
-using cloudshift.channel.Flow;
+using cloudshift.Channel;
using cloudshift.Mixin;
import js.Node;
@@ -67,7 +67,7 @@ class ServerSinkImpl extends SinkImpl {
world */
function myfill(payload,chanID,meta) {
- _chans.get(chanID)._defaultFill(Flow.createPkt(payload,"server",chanID,meta),chanID,null);
+ _chans.get(chanID)._defaultFill(Channel.createPkt(payload,"server",chanID,meta),chanID,null);
}
}
@@ -7,7 +7,7 @@ import cloudshift.channel.Flow;
import cloudshift.core.ObservableImpl;
using cloudshift.Mixin;
-using cloudshift.channel.Flow;
+using cloudshift.Channel;
class SinkImpl implements Sink {
public var part_:Part_<Conduit,String,Sink,SinkEvent>;

0 comments on commit a2cad5b

Please sign in to comment.