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

requesting doc for net.socket #199

Open
RuizuKun-Dev opened this issue May 18, 2024 · 7 comments
Open

requesting doc for net.socket #199

RuizuKun-Dev opened this issue May 18, 2024 · 7 comments
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@RuizuKun-Dev
Copy link

i'd like to bring awareness and request more documentation on net API and net.socket function in particular is lacking documentation and i have no clue how to use it or what it is for

@filiptibell filiptibell added documentation Improvements or additions to documentation good first issue Good for newcomers labels May 18, 2024
@CompeyDev
Copy link
Contributor

Is this not enough? I can't imagine describing what websockets are, on an API for websockets...

image

@RuizuKun-Dev
Copy link
Author

Is this not enough? I can't imagine describing what websockets are, on an API for websockets...

image

No, I have no clue what it’s for and how to use it

@CompeyDev
Copy link
Contributor

Websockets are a standard, so I feel like documentation for that does not belong in lune's docs, just like we do not explain what HTTP requests are in net.request.

Here is some handy docs on websockets. Perhaps we could link this in the docs, but it is a simple Google search away.

@RuizuKun-Dev
Copy link
Author

RuizuKun-Dev commented May 19, 2024

definitely don’t include everything but documentation should be beginner friendly and contain as much information as possible, it’s better to over communicate than to lack information in my opinion.

i also read the link you sent i still don’t understand the use cases for it, i googled it and ask GPT before i opened this issue

i’m interested in socket because i have a downloader and perhaps i can use it instead of net.request

@CompeyDev
Copy link
Contributor

perhaps i can use it instead of net.request

You probably don't need a websocket for downloading a file, since it is intended to be used for realtime communication inside a browser, like chat messages on a chat app. Once you download a file, you probably don't require a connection with the server and send messages to it back and forth.

Still, I strongly believe we should not include docs for basic web standards, at most, we can probably link some resources.

@RuizuKun-Dev
Copy link
Author

i see

My downloader is using net.request, what I don’t understand is how do other download managers have a progress bar and time estimate? is this even possible with the current net library?

@CompeyDev
Copy link
Contributor

CompeyDev commented May 20, 2024

No, this is not possible, you would require a stream API where you increment a progress bar on every byte received or something similar.

#200 is related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants