0.2.1 • Published 9 years ago

distributed-message v0.2.1

Weekly downloads
25
License
-
Repository
github
Last release
9 years ago

distributed-message

Abstract distributed framework message

Basic message that can be used for developing services of the distributed framework

installation

npm i distributed-message

build status

Build Status

api

This implementation has a very basic API, it gets extended by otehr message types

Contructor

var DistributedMessage = require('ditributed-message');

// create a new message that is ready to be sent
var message = new DistributedMessage({
	  sender: 'my-custom-uid'
	, recipient: {
		  applicationId : 'joinbox-website'
		, id 			: 'customer'
		, version 		: 0.1.x
	}
});

isValid()

checks the message validity (sender && recipient config must be present)

var validMEssage = message.isValid();

setSender(config)

Sets the sender config

// set uid
message.setSender('uid');

// or set config
message.setSender({
	  applicationId : 'joinbox-website'
	, id 			: 'customer'
	, version 		: 0.1.x
})

getSender(config)

Returns the sender config

var config = message.getSender();

setRecipient(config)

Sets the recipient config

// set uid
message.setRecipient('uid');

// or set config
message.setRecipient({
	  applicationId : 'joinbox-website'
	, id 			: 'customer'
	, version 		: 0.1.x
})

getRecipient(config)

Returns the recipient config

var config = message.getRecipient();
0.2.1

9 years ago

0.2.0

9 years ago

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago