Skip to content

[EPIC] v0.2.0: Streaming Support & High-Performance I/O #11 - #70

Merged
Bernardusz merged 25 commits into
mainfrom
development
Jul 17, 2026
Merged

[EPIC] v0.2.0: Streaming Support & High-Performance I/O #11#70
Bernardusz merged 25 commits into
mainfrom
development

Conversation

@Bernardusz

Copy link
Copy Markdown
Owner

Successfully added Keep-Alive and streaming support to Levtus

- Added checking body size per route and fall default to global size
- Edited Levtus and Router `addRoute()` to return the Node
- Added bodySize to Node
- Changed bodySize from int to long
- Add method `matchRoute()` to return the Node
- Refactored and separated exceptions into HTTP and Developer
- Created Exceptions for developer errors: BodyAlreadyConsumedException, DeveloperException (parent), and LevtusIOException (wrapper for UncheckedIOException)
- Created LevtusInputStream that extends InputStream and acts as guards
- Updated Request.java to accomodate method for body(), bodyAsString(), and bodyStream() with a safe bodyStream and unsafe one
- Created shortcut in LevtusContext for quick access
- Created StreamConsumer for safely accessing raw InputStream
feat: Implemented LevtusInputStream
- Changed HttpParser to add Response as a param to parseRequest
- Added Request as a param to validateBodySize to check bodySize before 100-Continue was accepted
- Remove automatically adding content type and server if absent and moved it to send(byte[] bodyBytes)
- Added helper method send() for 100-Continue method that sends nothing but request line and headers
- Added method overloading that will not send content length by default
- Added code 100 to the getStatusText Method
feat: Added 100-Continue implementation
- Changed BufferedInputStream into OutputSream in HttpConnectionHandler
- Added writeBody(Path path) that writes into the OutputStream of socket
- created sendFIle(Path path) that calls writeBody(Path) internally to add headers, status and flush and set isSent = true;
- Added helper method sendBinary(Path path) to set the type of file send to octet stream
- Added helper method sendBinary(String) and sendFile(String) to grab file from relative path (staticFilesPath)
- Reformed render to use sendFile internally
- Changed all the implicit error code sending to throwing DeveloperExceptions
- Added tests for all changes
feat: Added zero-copy file sending for Levtus
- Added getter and setters (chunkSize() and withChunkSize()) for default size per chunk
- Changed maxBodySize from int to long to align with HTTP's spec
- Added method to check the sending method of client/sender
- Make sure calling body() family method only throws Levtus' internall exceptions
- Added chunked reading capability in LevtusInputStream and made sure Request is compatible
- Made it so LevtusIOException extends DeveloperException
- Added needed test

Note: Skipped trailer support for transfer encoding, as it is rarely used and doesn't align with Levtus' microservice needs
feat: Added capability to stream via Chunked Transfer encoding.
- Added HttpProtocol parser inside HttpParser to determine the protocol version (1.0/1.1)
- Added capability for Levtus to accept connection close without waiting for timeout
- Fixed bugs where methods call themselves in LevtusContext
- Added Date to the header if user hasn't defined the date header yet
- Added private method inside Response for getMimeType, getCurrentDate
- Added helper method to send/stream file as a download
- Added nescecary tests
feat: Added download helper method and Date placeing if absent
- Changed HashMap to ConcurrentHashMap for thread safety
- Mark all wildcard variable as volatile
- Added initialSocketTimeout variable for waiting the incoming HTTP Request's metadata
- Added processingSocketTimeout for waiting the incoming HTTP Request's data/body
- Added setters and getters for both
refactor: Allow for user defined socket timeout
- Add development branch, which is the final step before pushing to main, to CodeQL Advanced
- Add labeler.yml
- Changed version in pom.xml to version 0.2.0
- RUn Google Java Plugin on every file
@Bernardusz Bernardusz added this to the v0.2.0 - The Streaming Era milestone Jul 17, 2026
@Bernardusz Bernardusz self-assigned this Jul 17, 2026
@Bernardusz Bernardusz added the enhancement New feature or request label Jul 17, 2026
@github-project-automation github-project-automation Bot moved this to Backlog in Levtus Jul 17, 2026
@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

  • .github/workflows/qodana_code_quality.yml

- Changed downloadFile methods to return void, as it cannot be chained because the Response has been flushed
- Fixed the JavaDoc for Levtus
@Bernardusz
Bernardusz merged commit e1c5792 into main Jul 17, 2026
8 of 9 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Levtus Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant