Currently I am using just simple type and payload structure which will work for a small amount of services, but as amount of services will grow we will encounter bunch of naming collisions. And overall to name the methods will be harder.
Right now i have an idea to mimic the RPC style where wss message should define the service and the method it is calling.
Also i am thinking how to version the methods. Most likely, i don't need to version services as those will be pretty stable, but methods and messages(payload)definitely will be modified over the time.
So, let's define pseudo message shape for now:
/**
* Messages
*/
const ListModulesRequestPayload {
parent: action.payload.id,
page_size: action.payload.pageSize,
page_token: action.payload.pageToken,
}
/**
* Websocket.Send will be an action creator function taking those 3 arguments.
* Object used to describe the signature.
*/
WebsocketActions.Send: {
service: 'ModulesService',
rpc: 'ListModulesRequest',
message: ListModulesRequestPayload,
}
Currently I am using just simple
typeandpayloadstructure which will work for a small amount of services, but as amount of services will grow we will encounter bunch of naming collisions. And overall to name the methods will be harder.Right now i have an idea to mimic the RPC style where
wssmessage should define the service and the method it is calling.Also i am thinking how to version the methods. Most likely, i don't need to version services as those will be pretty stable, but methods and messages(payload)definitely will be modified over the time.
So, let's define pseudo message shape for now: