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 Socket.IO API for all commands + app info #13

Open
benjaminbojko opened this issue Feb 21, 2022 · 12 comments
Open

Add Socket.IO API for all commands + app info #13

benjaminbojko opened this issue Feb 21, 2022 · 12 comments
Labels

Comments

@benjaminbojko
Copy link
Collaborator

No description provided.

@benjaminbojko benjaminbojko transferred this issue from another repository Mar 9, 2022
@pingevt
Copy link
Member

pingevt commented Aug 11, 2022

Of all the APIs - I think it makes sense to try this one first and build around it. I'm thinking the dashboard "should" be built with sockets, for realtime comm.

@pingevt pingevt self-assigned this Aug 11, 2022
@pingevt
Copy link
Member

pingevt commented Aug 11, 2022

@benjaminbojko - I've been trying to start a PoC, just a few questions, I'm running into...

  • Is there a defined (easy) way to run launchpad not from the command line? As a POC, I'm able to run content download, but I'm importing packages at random, instead of a unified "launchpad" object.
  • Is there a way to extend logging class? Currently seems like fo this I would have to read the error logs individually, rather than react on a logging event.

@benjaminbojko
Copy link
Collaborator Author

@pingevt we should talk about this. There's already scaffolding in place that you should be able to use: https://github.com/bluecadet/launchpad/blob/develop/packages/core/lib/command-center.js

I'm unfortunately a little swamped today but perhaps we can find a time next week.

I'd like to take some time to really think about the architecture and not just go by iterative testing here because that's how the previous version evolved :D

Socket.io seems like a good start. It will need a local web server and I did some research on that too: https://www.notion.so/bluecadet/Launchpad-Roadmap-24b7447a2b414aec824a87c64af5b99b#834c7e5e2cd74181836ec57807649dfe

@pingevt
Copy link
Member

pingevt commented Aug 11, 2022

Agreed on we should talk some time! Also, my head has been in the content side and not much else of Launchpad, so I'm just trying to familiarize myself rather than make production ready code. Trying to take advantage of some down time so I can hit the ground running when something is needed for a project.

@pingevt
Copy link
Member

pingevt commented Aug 11, 2022

Re. the logging... looks like we can add Custom Transports. I think we need to add that ability to the config file for launchpad itself.

EDIT: no need to update the config.

@pingevt
Copy link
Member

pingevt commented Aug 11, 2022

A Proof of Concept video in slack: https://bluecadet.slack.com/archives/C03RY7MRA4V/p1660247236938769

@benjaminbojko
Copy link
Collaborator Author

@pingevt something like this could also be an interesting alt or additional layer to add: https://www.npmjs.com/package/reconnecting-websocket

@pingevt
Copy link
Member

pingevt commented Aug 22, 2022

So I've been reading up on websockets vs. socket.io. Someone made the comparison of jQuery and vanilla js... so now I don't want to use socket.io. Anyways, I'm getting 2 main bonuses of socket.io, 1 fallbacks when websockets aren't available, and 2 auto reconnect.

Given the package above, that takes care of part 2. And the fact we typically can define what our audience uses and aren't distributing this to a public mass audience I'm wondering if part 1 is worth dealing with. Socket.io creates some conveniences, but at a quick glance, seems like either/or to me. Its slightly less code, but does that make it worth it?

@benjaminbojko
Copy link
Collaborator Author

Yeah those are good points. Do keep in mind that the reconnecting websocket package is only for JS, so we won't be able to use it for C++ or C#. My main rec would be to make the API modular enough to allow for multiple protocols to work in parallel. So worst case, we could allow for folks to choose Socket.io or WebSockets eventually, but we could start with WebSockets to reduce bloat.

Sort of related, this also made me wonder if we should actually break out each of these layers as their own packages, to reduce dependencies. The same might make sense for the content sources, actually... Food for thought eventually.

@pingevt
Copy link
Member

pingevt commented Aug 22, 2022

wait - good point, but isn't socket.io for js (and web) only as well? we might have todo more for C++ or C# clients.

@benjaminbojko
Copy link
Collaborator Author

We have existing C++ implementation afaik, but tbh that's pretty ancient. There also seem to be C# socket.io packages, but those haven't seen updates in a few years either.

I think you're right that starting with just plain WebSockets seems the way to go here, especially since writing a simple reconnect function that doubles the reconnect interval on each attempt until a max is pretty easy.

@pingevt pingevt removed their assignment Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants