Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add transport into message context #81

Closed
jakubkoci opened this issue Aug 11, 2020 · 0 comments · Fixed by #256
Closed

Add transport into message context #81

jakubkoci opened this issue Aug 11, 2020 · 0 comments · Fixed by #256
Assignees

Comments

@jakubkoci
Copy link
Contributor

jakubkoci commented Aug 11, 2020

As a Developer, I want to have information about the transport layer to dispatch the outbound wire message properly. For example, if an inbound wire message was sent via WebSocket I need that information together with Socket ID and other details to send the outbound message by emitting event to the same WebSocket.

Then I could implement OutboundTransporter interface in a similar way (take the example only for demonstration purposes):

class WebSocketOutboundTransporter implements OutboundTransporter {
  ...
  async sendMessage(outboundPackage: OutboundPackage) {
    const { socketId } = outboundPackage.transport
    const socket = socketById(socketId);
    socket.emit('ariesMessage', outboundPackage.wireMessage);
  }
  ...
}

Ideally, the framework should not contain any mention about the transport layer, I mean, we should just past Transport (or TransportContext) object from MessageReceiver through the framework to MessageSender without revealing or processing information inside.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants