Skip to content

Support streams #9

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

Closed
makew0rld opened this issue Jun 22, 2020 · 14 comments
Closed

Support streams #9

makew0rld opened this issue Jun 22, 2020 · 14 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request roadmap A user-facing feature on the roadmap.

Comments

@makew0rld
Copy link
Owner

makew0rld commented Jun 22, 2020

An example page with a stream URL is gemini://chat.mozz.us, with the actual stream at gemini://chat.mozz.us/stream.

Even for plaintext streams like the one above, this would require a major architectural change, since Pages are designed to hold their entire content in a string. A work around could be a stream mode, which might be hard/annoying to get the user to choose though. Could be a shortcut, so they select a link and then press Ctrl-S, or maybe it could be dynamically determined once content reaches a certain length, or the connection doesn't close?

Edit: I no longer consider stream mode to be a viable solution. Large non-stream pages would also benefit from Amfora moving to a stream-based architecture.

@makew0rld makew0rld added the enhancement New feature or request label Jun 22, 2020
@makew0rld
Copy link
Owner Author

makew0rld commented Jun 23, 2020

Hopefully a status code for a stream will be added.

Edit: This will not be happening.

@makew0rld makew0rld added this to the v1.3.0 milestone Jun 29, 2020
@makew0rld
Copy link
Owner Author

makew0rld commented Jun 30, 2020

The rendering functions should already work well with partial content, maybe only passing parts of content can be the default mode, updating the Page each time? The only state that would need to be passed each call would be whether it's in a preformatted mode or not, which could be added to Page or something.

@makew0rld
Copy link
Owner Author

makew0rld commented Jul 2, 2020

Stream support will require the ability to load URLs and setpages even when another tab is selected. This means the tab number should be passed to funcs like handleURL and setPage, so they don't just use curTab. There will also have to be a way to stop the loading when the tab is closed.

Edit: The first part of this is completed.

@makew0rld makew0rld removed this from the v1.3.0 milestone Jul 2, 2020
@makew0rld makew0rld added the roadmap A user-facing feature on the roadmap. label Jul 2, 2020
@makew0rld makew0rld added this to the v1.4.0 milestone Jul 2, 2020
@makew0rld
Copy link
Owner Author

As of 7fe78f4 there is now a configurable download timeout on pages. This would need to be disabled for streams.

@makew0rld
Copy link
Owner Author

There could be a render and page display pipeline that implements io.Writer, so network input can be written directly and displayed live.

@makew0rld makew0rld removed this from the v1.4.0 milestone Jul 28, 2020
@makew0rld
Copy link
Owner Author

makew0rld commented Aug 15, 2020

Using the protocol gemini+stream:// has been proposed. It is no longer encouraged or "required", see here.

@makew0rld
Copy link
Owner Author

makew0rld commented Nov 20, 2020

The default 2 MiB page limit can be upped or page limits can be removed entirely once this is implemented.

Edit: Maybe just upped instead of removed, so that infinite or gigantic pages don't take up too much memory

@makew0rld
Copy link
Owner Author

Once this feature is added the info bar (#142) code will have to be modified so that the total page lines and page percentage changes on the fly.

@makew0rld makew0rld added the documentation Improvements or additions to documentation label Dec 15, 2020
@makew0rld makew0rld modified the milestones: v1.8.0, v1.9.0 Dec 24, 2020
@makew0rld
Copy link
Owner Author

What is described in #182 is closely related to this.

@makew0rld
Copy link
Owner Author

makew0rld commented Mar 1, 2021

There should be a line-based parser that implements io.ReadWriter. Each tab will have a parser and also be refactored to hold the network connection. Page can be changed so that Raw and Content are bytes.Buffer. To load a page, the tab will copy the incoming network bytes to Raw and to the parser, and then copy the parser output to Content and the TextView of the tab. When loading a new page, the parser will be scrapped and recreated, and the old network connection closed.

The parser will also have a links channel (buffered), which the tab can pull from to fill the Links slice of the Page. Page will probably need a mutex, in case the user is tabbing around the links while the page is loading.

@makew0rld
Copy link
Owner Author

This happening on the stream branch.

@makew0rld
Copy link
Owner Author

Look into #57 once this is done and see if it can be closed too.

@makew0rld makew0rld modified the milestones: v1.9.0, v1.10.0 Dec 3, 2021
@makew0rld
Copy link
Owner Author

Moving this to v1.10.0. It has been slowing down the release of v1.9.0 for much too long. There are more important updates that are already in master but are unreleased, or still need to be added. This would be great to have but is not really important from a user's point of view.

@makew0rld makew0rld modified the milestones: v1.10.0, v1.11.0 Feb 4, 2024
@makew0rld makew0rld removed this from the v1.11.0 milestone Dec 19, 2024
@makew0rld
Copy link
Owner Author

I am closing all stale non-bug issues so this issue will be closed. A PR for this is unlikely to be accepted since Amfora is in maintenance mode and this would be a major change.

Goodbye streams, we hardly knew ye.

@makew0rld makew0rld reopened this Dec 19, 2024
@makew0rld makew0rld closed this as not planned Won't fix, can't repro, duplicate, stale Dec 19, 2024
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 enhancement New feature or request roadmap A user-facing feature on the roadmap.
Projects
None yet
Development

No branches or pull requests

1 participant