Skip to content

Commit

Permalink
idempotent requests, cacheable requests, corked requests, all possible
Browse files Browse the repository at this point in the history
  • Loading branch information
Dnaganog committed Aug 10, 2019
1 parent bcfd08f commit d3c2692
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 3 additions & 1 deletion examples/firecomm/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ const firstChat = {

// testClientStream();

const newClient = stub.clientStream()
const newClient = stub.clientStream(
{hello: 'world yo',
options: {idempotentRequest: true}})
.send({message: 'yolo'})
.send(firstChat)
.on((data) => console.log({ data }))
Expand Down
1 change: 1 addition & 0 deletions examples/firecomm/methodHandlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ function clientStream(call) {
// console.log(context.__proto__);
// console.log('serverStream context: ', context);
// console.log(context.metadata, context.metaData);
console.log(call.head);
call.set(
{please: 'work', dear: 'dog'}
)
Expand Down
8 changes: 6 additions & 2 deletions lib/clientCalls/clientStreamCall.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@ module.exports = function clientStreamCall(that, methodName, first, second) {
if (Array.isArray(first)) {
interceptors = { interceptors: first };
} else {
metadata = generateMeta(first);
const {options} = first;
delete first.options;
metadata = generateMeta(first, options);
}
}
if (typeof second === "object") {
if (Array.isArray(second)) {
interceptors = { interceptors: second };
} else {
metadata = generateMeta(second);
const {options} = second;
delete second.options;
metadata = generateMeta(second, options);
}
}
let callback = function(err, res) {
Expand Down

0 comments on commit d3c2692

Please sign in to comment.