explanation.txt 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. 2 Jan 2025:
  2. Things to do:
  3. - Get the socket transwmission working first.
  4. - Sepearate out the logic for receiver Identification, make it modular
  5. - Put actor concept aside. That one will be a separate project
  6. Concept as of 5/12/2024:
  7. So, when an application run, it will instantiate the transmission manager that will in turn instantiate adapter manager. The adapter manager will turn first check the
  8. configuration file, whether a config json file or .env depending on the environment, and set up the necessary transport services in order to be able to create the
  9. necessary adapter instance, but not right away. It will have the information, but not create them right away, unless there are already clients connected. The adapter
  10. manager would also cater for the situation that it would also connect with existing transport that are active. Of course, the details for such mechanism are yet to be
  11. discussed further. Until then, current context will only assume that this adapter will instantiate the necessary components. Now the scenario is such way that when
  12. there a client receiver that wishes to connect, it will first perform then necessary handshake protocol, in this socket case, which is to specify whether or not
  13. the client is a new clietn or a previously connected client. Then the tranpsort services that was instantiated earlier on by the adapter will first assign the necessary
  14. details to the connected clients so that the information of the client is first established and kept in record so to speak. Same things goes for previius client, Until
  15. the transport service can establish their respective identiites, no message transmission will be carried out, and in the case of old clients, the transmitted messages
  16. will still be in the buffer. So, once the identities of the clients receiver has been established, the transport service will then in turn publish a transport event,
  17. and then transmission manager who had been subscribed to that event bus will pick up the signal so to speak, and instantiate the necessary transmission components.
  18. So what happens here also, is that during that procress, it will also liase with adapter manager to instantiate and return available adapters, so that that it can
  19. included in part of the transmission set. So once, the "package" of transmsision set is ready, which by now consists of a set of transmission and it's respective
  20. adaptesr, along side with the buffer mechanism in place, the application or the producer or client if you would can start using these transmitter and receiver
  21. transmission components to start sending and receiving messages without having to worry about the underlying transport system.
  22. Things to note, the logic to decide which adapter to use and how many adapters will be placed in transmitter tramsmission itself. Naturally, there would be
  23. presumably eitehr a performnace metrics measurement of it's kind, whether self-written or an existing library to be consulted so to speak, before deciding
  24. on the usage of the available adapters. The transmission components will also have the ability to take and throw away their adapters, depending on the signal
  25. given by transmission manager. Essentially, transmission manager will keep itself up to date via the aforementioned event bus, and notify and return additional
  26. adapters if there are any. Adapter manager will basically keep an out or instantiate more circumstantially, and will update transmission manager via the event bus.
  27. Things to do:
  28. - Connection Manager to manage different transport options. Default using websocket, but will also consider fail detection on each transport and decide on adapters swap
  29. - Also need to cater for browser environment. Right the now, the default behaviour is that one would assume to instantiate a socket server, instead of client.
  30. Need to cater for those cases too.
  31. Target for week: (Same for Week4)
  32. i) R&D for multi channel data traversal.
  33. -That means utilizing multiple TCP ports or network cards or transport services.
  34. -To be Prep via documents for discussion
  35. ii) Functional Http Service options to be made available.
  36. -Default transport will be geared towards socket at the moment.
  37. iii) Code Adjustments and Cleaning
  38. -Make sure the file structure and folders are in order
  39. -Necessary comments
  40. iv) Documentation
  41. -A special Readme file to help understand the usage and what it does.
  42. -Also guide for future enhancements
  43. DONT FORGET TO UPDATE SPICEWORK!!!!!!
  44. Optiomal but cool things to do:
  45. i) A global logging service that can be configured and toggled <DONE>
  46. - instead a console.log, create a logging features in utility. It's like nestjs version but but my own. It will just read from logSetting.json configurations
  47. Things to be discuss later: (as of 2/12/2024)
  48. i) If a service crashes and comes back up, does client(UI sender) still send requests?
  49. -Since the service loses all it's memory and have no clue who were connected and what it was doing unless there's a state machine.
  50. -Current paradigm only solves for internet disruption, it doesn't assume either of the sender and receiver crashes.
  51. Discussion points as of 5th December:
  52. i) Transmission Components can be using multiple adapters for transmission operatores. There would be utilities to measure performances as such
  53. to be included in the near future.
  54. ii) Actor system: May or may not expose methods circumstantially. So it all depends. But utlize interfaces for services and have them become functional so thatit
  55. it can be reusedd again
  56. iii) Learn how to use uml to better represents my ideas and absracting a concept so to speak.
  57. Dont' forget about depedencies injection
  58. Note: As for the Http
  59. - Understandably it works differently, but nevertheless, the existing code to emulate channel via just tranmission and emission will remain the same.
  60. OF course, ample efforts to use request-response adapter will be allocated to fuflill chin's vision, but nevertheless, the standard channel concept is to
  61. be preserveed for consistencies.
  62. -So going forward, after the UML draft is done, continue with the http development, so that I can test out multiple use of transport services. Of course, I can
  63. probably also use 2 socket, but it just feels wrong.
  64. DevLog:
  65. As of 12/12/2024:
  66. -Fixed the axios error by cutting out the timeout param, but it also expose other problems, in that the reconnection logic needs to be fixed, because it always
  67. reconnect under new profile?? have to check again.
  68. As of 14/12/2024:
  69. Discussion points during meeting: Keep track and monitor the performance and it's associated ram and cpu usage. When coding, keep track of the instances instantiated from
  70. overloading the system. It's not just getting the behavior right, but also making sure unused var and instances are also properly organized and deleted when no longer used to
  71. prevent memory leak.
  72. And there's going to be an upcoming meeting to present my findings and progress:
  73. Target for the day: Get the HTTP Services ready. at least the channel version, so that I get right on with the testing and proceed with Emulating request Response adapter.
  74. As of 16/12/2024: (Monday)
  75. -SO tomorrow I have to present something concrete. Will first finish up the UML diagram, and then proceed to hash out whatever errors there is for HTTP servcies.
  76. -If I manage to hash out all the remaining problems. Then proceed to do request response. Test with same app first, before developing for web UI version. it use fetch
  77. instead of axios, so there's going to be some tweaking.
  78. Calm down, don't be stupid, it's just a game. Focus on what's I'm supposed to do today.