forked from maxtaco/node-framed-msgpack-rpc
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathclient.js
More file actions
103 lines (94 loc) · 3.01 KB
/
client.js
File metadata and controls
103 lines (94 loc) · 3.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
// Generated by IcedCoffeeScript 108.0.12
(function() {
var Client, iced, __iced_k, __iced_k_noop;
iced = require('iced-runtime');
__iced_k = __iced_k_noop = function() {};
iced = require('./iced').runtime;
exports.Client = Client = (function() {
function Client(transport, program) {
this.transport = transport;
this.program = program != null ? program : null;
}
Client.prototype.invoke = function(method, args, cb) {
var arg, err, res, ___iced_passed_deferral, __iced_deferrals, __iced_k;
__iced_k = __iced_k_noop;
___iced_passed_deferral = iced.findDeferral(arguments);
arg = {
program: this.program,
method: method,
args: args,
notify: false
};
(function(_this) {
return (function(__iced_k) {
__iced_deferrals = new iced.Deferrals(__iced_k, {
parent: ___iced_passed_deferral,
filename: "/Users/chrisnojima/go/src/github.com/keybase/node-framed-msgpack-rpc/src/client.iced",
funcname: "Client.invoke"
});
_this.transport.invoke(arg, __iced_deferrals.defer({
assign_fn: (function() {
return function() {
err = arguments[0];
return res = arguments[1];
};
})(),
lineno: 15
}));
__iced_deferrals._fulfill();
});
})(this)((function(_this) {
return function() {
return cb(err, res);
};
})(this));
};
Client.prototype.invoke_compressed = function(method, ctype, args, cb) {
var arg, err, res, ___iced_passed_deferral, __iced_deferrals, __iced_k;
__iced_k = __iced_k_noop;
___iced_passed_deferral = iced.findDeferral(arguments);
arg = {
program: this.program,
method: method,
ctype: ctype,
args: args,
notify: false
};
(function(_this) {
return (function(__iced_k) {
__iced_deferrals = new iced.Deferrals(__iced_k, {
parent: ___iced_passed_deferral,
filename: "/Users/chrisnojima/go/src/github.com/keybase/node-framed-msgpack-rpc/src/client.iced",
funcname: "Client.invoke_compressed"
});
_this.transport.invoke(arg, __iced_deferrals.defer({
assign_fn: (function() {
return function() {
err = arguments[0];
return res = arguments[1];
};
})(),
lineno: 20
}));
__iced_deferrals._fulfill();
});
})(this)((function(_this) {
return function() {
return cb(err, res);
};
})(this));
};
Client.prototype.notify = function(method, args) {
var program;
method = this.make_method(method);
program = this._program;
return this.transport.invoke({
program: this.program,
method: method,
args: args,
notify: true
});
};
return Client;
})();
}).call(this);