Skip to content

Commit

Permalink
Documentation: Tweaked sendMessage
Browse files Browse the repository at this point in the history
In the documentation removed the reference to using the service name as the first parameter.
Also removed the service name from the sendMessage in the blue-service.js example code.
  • Loading branch information
Jedediah Smith committed Mar 4, 2017
1 parent 403dc68 commit 02babcd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ let message = hydra.createUMFMessage({
fileData: '{base64}'
}
});
hydra.sendMessage('upload-service', message);
hydra.sendMessage(message);
```
The first parameter is the name of the service you want to send a message to, and the second parameter is a UMF formatted object containing a message.
Expand Down Expand Up @@ -635,12 +635,11 @@ Sends a message to all present instances of a hydra service.
/**
* @name sendMessage
* @summary Sends a message to all present instances of a hydra service.
* @param {string} serviceName - Name of service
* @param {string | object} message - Plain string or UMF formatted message object
* @return {promise} promise - resolved promise if sent or
* error in rejected promise.
*/
sendMessage(serviceName, message)
sendMessage(message)
```
Expand Down
2 changes: 1 addition & 1 deletion tests/messaging/blue-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ hydra.init(config.hydra)
console.log(`Received object message: ${msg.mid}: ${JSON.stringify(msg)}`);
});
setInterval(() => {
hydra.sendMessage('red-service', hydra.createUMFMessage({
hydra.sendMessage(hydra.createUMFMessage({
to: 'red-service:/',
from: 'blue-service:/',
body: {
Expand Down

0 comments on commit 02babcd

Please sign in to comment.