Skip to content

Commit

Permalink
Server Stream is working as intended, able to pass configurations for…
Browse files Browse the repository at this point in the history
… requests in metadata
  • Loading branch information
Dnaganog committed Aug 11, 2019
1 parent ce0d844 commit cc6576b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
18 changes: 14 additions & 4 deletions examples/firecomm/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,26 @@ const firstChat = {

// const testServerStream = () => {
// const serverStream = stub.serverStream(firstChat);
const serverStream = stub.serverStream();
const serverStream = stub.serverStream(
{
stream: 'server',
options: {
idempotentRequest: true,
cacheableRequest: true,
corked: true,
waitForReady: false,
}
}
);
serverStream.write(firstChat);
serverStream.on("data", data => {
console.log({data});
console.log(data);
})
serverStream.on("status", status => {
console.log({status});
console.log(status);
})
serverStream.on("metadata", metadata => {
console.log({metadata});
console.log(metadata);
})
.catch((err) => console.error(err));
// };
Expand Down
1 change: 1 addition & 0 deletions examples/firecomm/methodHandlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ function unaryChat(call) {

function serverStream(call) {
// console.log(context);
call.set({server: 'streamed metadata'})
let count = 0;
setInterval(() => {
count += 1;
Expand Down

0 comments on commit cc6576b

Please sign in to comment.