static public void DispatchViaHttp(CallAttr attr, ResponseDelegate d, string url, object[] args = null, Dictionary <string, object> headers = null) { var ctx = new WebYieldContext(attr, d, url, args, headers); web_dispatchers.Add(ctx); }
protected string ParseMethodName(string method, object[] args, ref CallAttr attr) { attr.notify = false; attr.async = false; attr.timeout = 5000; return(method); }
public void Notify(Actor a, CallAttr attr, string method, object[] args) { WriteStream(Merge(new object[3] { KIND_NOTIFY_SEND, a.Id, method }, args)); }
public void Send(Actor a, CallAttr attr, string method, object[] args, ResponseDelegate d) { var msgid = TransportManager.NewMsgId(); Dispatch(Merge(new object[5] { KIND_SEND, a.Id, msgid, method, null }, args), attr, msgid, d); }
public WebYieldContext(CallAttr attr, ResponseDelegate d, string url, object[] args, Dictionary <string, object> headers) { var str = Json.Serialize(args); byte[] body = System.Text.Encoding.ASCII.GetBytes(str); this.d = d; this.timeout_at = Time.time + attr.timeout; //Debug.Log("WWW parm:" + url + "|" + str + "|" + headers); _www = new Curl(url, body, headers); _reader = Start(); }
static public void Yield(uint msgid, CallAttr attr, ResponseDelegate d) { dispatchers[msgid] = new YieldContext { d = d, timeout_at = Time.time + attr.timeout }; }
void Dispatch(object[] req, CallAttr attr, uint msgid, ResponseDelegate d) { WriteStream(req); TransportManager.Yield(msgid, attr, d); }