Skip to content

chore(nodejs): extract transport and buffer from sender, add back support for core http #48

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

glasstiger
Copy link
Collaborator

@glasstiger glasstiger commented Jul 16, 2025

Extracting the transport layer from Sender, and introducing the SenderTransport interface with different implementations:

  • TCP transport: uses a socket with ILP over TCP
  • HTTP transport: uses node's core http module with ILP over HTTP
  • HTTP Undici transport: uses the undici module with ILP over HTTP

Also extracting the buffer from Sender into a class SenderBuffer.
Now the Sender is mostly just wiring between a transport and a buffer, and responsible only for auto flushing.
In fact, you could create your own transport and buffer, and use them without a Sender if you are calling flush() manually.
You could also create your own pools of buffers and transports, the transports could be even different types, and just flush your buffers when needed using one of the transports from the pool.

Also refactored and improved tests.
Introduced more types, such as Logger, ExtraOptions, TimestampUnit and MockConfig.
Fixed any and unknown type warnings.

@glasstiger glasstiger changed the title chore(nodejs): extract transport from sender, add back support for core http chore(nodejs): extract transport and buffer from sender, add back support for core http Jul 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant