explanation.txt 4.3 KB

12345678910111213141516171819202122232425262728293031
  1. Currently the way it works is, tranport service, which is the websocket or http or whatever transport protocol that is selected will have a universal emit and subscribe public method
  2. so, the concept of having bi directional will be somewhat weaved into every class object of said transport service. What it will do is that, when a client is connected, i mean it
  3. doesn't have to be literally like in the case of http, we will assume a logical channel so to speak. So when a client is connected, the connected client will be assinged an ID,
  4. one that will be used by the connection manager to instantiate a set of adapter with the assigned id, to identify the client as well as the type of transport it used.
  5. Essentially, a set of adapter is tied to one client and it's associated transport type.
  6. There the core of this transport interface, or at least that what I will choose to call it, will communicate with transmission manager, which in turns will be communicating with
  7. connection manager to handle how the message is received and transmitted. The need for this is to allow the integration for re-transmission service, so that messagecan be
  8. re-transmitted over, should there be an interuption of sorts.
  9. Now, in this context, we are talking about a server that can have multiple client connected to it, so that means there is a need to manage multiple 'traffic' with these connectedc
  10. clietns. To remember their credentials so as to be able to handle retransmission should they lost connection for whatever reasons, while dealing with various type of transport.
  11. FOr now, the example provided is only using websocket at the moment, another transport sample, which is http will be prepared at a later stage when i get this websocket working,
  12. with multiple clients as well as the server acting as a receiver itself.
  13. So, when an application starts, which assume to be the provider, will instantiate a transmission manager. The transmission manager will in turn instantiate a connection mnager ,
  14. and the connection manager will also instantiate a transport service specified at .env file. Once that is done, the connection manager will then subscribe to the transportevent
  15. also instantiated within it's component, and be exposed to transmission manager as well, so that all the concerned parties that are subscribed to transport event, will know what's
  16. happening. So, in this websocket's context: A client is connected, a transport event is reported and announced. Connection manager will listen to this type of event and
  17. instantiate a set of adapters to cater for this specific client. It will keep a copy with it's class, and can be retrieved by transmission transmitter and receiver and request response
  18. class. They too will also be listening to new adapter set event so to speak, and store the reference pointer in it's own local memory array.
  19. So here's how it is, the app which is
  20. the producer, once calls for transmission manager to instantiate a set of transmission methods, which is the message transmitter, receiver and request response class, which doesn't
  21. care what the underlying transport that is being used, will use the instantiated objects to perfrom all the available methods to transmit and receive message, even as far as
  22. emulating request response behaviour. So, when the producer wants to send a message, it will send through the message transmitter instantiated earlier. By the way, forgot to mention,
  23. when a client is connected, an ID will be assinged to the client, the same id that was assigned is also assigned to the adapter, which makes it easier to be managed later as I continue
  24. to develop this point. I probably mentioned this a few paragraphs, but anyway, as I was sating the message transmitter will read the message and see what adapter it's using,
  25. and search through it's array adapter ref, to find the matching adapterID, and then using that adapter to pass along the message. The adapter tha was chosen would have already been
  26. mapped with it's associated transport service to send the message out to the respective clients. At least that whole gist of it.
  27. With that in mind, the retransmission service will sit at the adapter side, since each adapter is tied to one client and it's respective transport type, so it's easier to manage.
  28. All events or activities will go through one, well "global" subject, which is the transport event instantiated at connection manager.