Skip to content

Commit

Permalink
only Channel has packet accessors
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudshift committed Mar 12, 2012
1 parent 2020726 commit a2cad5b
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 44 deletions.
38 changes: 0 additions & 38 deletions cloudshift/channel/Flow.hx
Expand Up @@ -108,44 +108,6 @@ class Flow {


#end #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} };
}




} }
2 changes: 1 addition & 1 deletion cloudshift/channel/PipeImpl.hx
Expand Up @@ -6,7 +6,7 @@ using cloudshift.Mixin;
import cloudshift.Channel; import cloudshift.Channel;
import cloudshift.channel.Flow; import cloudshift.channel.Flow;


using cloudshift.channel.Flow; using cloudshift.Channel;


class PipeImpl<T> implements Chan<T> { class PipeImpl<T> implements Chan<T> {


Expand Down
4 changes: 2 additions & 2 deletions cloudshift/channel/PushClientImpl.hx
Expand Up @@ -66,7 +66,7 @@ class PushClientImpl implements Conduit {
public function public function
pump(sessID:String,userData:Dynamic,chanID:String,meta:Dynamic) { pump(sessID:String,userData:Dynamic,chanID:String,meta:Dynamic) {
var var
ud = Flow.createPkt(userData,_sessID,chanID,"m",meta), ud = Channel.createPkt(userData,_sessID,chanID,"m",meta),
pl = haxe.Serializer.run(ud), pl = haxe.Serializer.run(ud),
req = new haxe.Http(_url+Flow.PUSH); req = new haxe.Http(_url+Flow.PUSH);


Expand Down Expand Up @@ -137,7 +137,7 @@ class PushClientImpl implements Conduit {
function function
client(cmd:String,userData:Dynamic,chanID:String,cb:Dynamic->Void) { client(cmd:String,userData:Dynamic,chanID:String,cb:Dynamic->Void) {
var var
ud = Flow.createPkt(userData,_sessID,chanID,cmd), ud = Channel.createPkt(userData,_sessID,chanID,cmd),
pl = haxe.Serializer.run(ud), pl = haxe.Serializer.run(ud),
req = new haxe.Http(_url+Flow.PUSH); req = new haxe.Http(_url+Flow.PUSH);


Expand Down
2 changes: 1 addition & 1 deletion cloudshift/channel/PushListenerImpl.hx
Expand Up @@ -11,7 +11,7 @@ import cloudshift.Http;
import cloudshift.http.HttpImpl; import cloudshift.http.HttpImpl;
import cloudshift.core.ObservableImpl; import cloudshift.core.ObservableImpl;


using cloudshift.channel.Flow; using cloudshift.Channel;
using cloudshift.Mixin; using cloudshift.Mixin;


import js.Node; import js.Node;
Expand Down
2 changes: 1 addition & 1 deletion cloudshift/channel/ServerSinkImpl.hx
Expand Up @@ -67,7 +67,7 @@ class ServerSinkImpl extends SinkImpl {
world */ world */


function myfill(payload,chanID,meta) { 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);
} }


} }
Expand Down
2 changes: 1 addition & 1 deletion cloudshift/channel/SinkImpl.hx
Expand Up @@ -7,7 +7,7 @@ import cloudshift.channel.Flow;
import cloudshift.core.ObservableImpl; import cloudshift.core.ObservableImpl;
using cloudshift.Mixin; using cloudshift.Mixin;


using cloudshift.channel.Flow; using cloudshift.Channel;


class SinkImpl implements Sink { class SinkImpl implements Sink {
public var part_:Part_<Conduit,String,Sink,SinkEvent>; public var part_:Part_<Conduit,String,Sink,SinkEvent>;
Expand Down

0 comments on commit a2cad5b

Please sign in to comment.