Giter Site home page Giter Site logo

Comments (3)

MichaelSun90 avatar MichaelSun90 commented on September 22, 2024 2

Hi @jdanyow , thanks for bring this up. We have not yet discussed this, but we will definitely keep an eye on this. If the connect() API is standard across runtimes include Nodejs in the future, the custom socket feature PR 1540may able to handle it already. However, it definitely need to be tested.
The custom socket feature allow user to use a socket and its corresponding connect function beside the one we default used in tedious.

from tedious.

arthurschreiber avatar arthurschreiber commented on September 22, 2024 1

Hey @jdanyow,

I looked at this. It seems like the connect API is basically a way to get a network socket that implements the webstreams Duplex API.

tedious is currently built on top of the networking functionality provided by the net and tls modules - we probably can switch that longterm to using the connect shim (which basically just provides web streams that tie back into nodejs' networking APIs).

It would involve some internal refactorings to switch to the web streams api, and we probably would also need to assess the performance impact of having that additional layer between tedious and the nodejs networking APIs. If you want to investigate what changes this would require, feel free to open a PR so we can have an initial discussion. If you can't invest time into this, we will probably not be able to look into this anytime soon, as we have some other higher priority items that we'd like to focus on.

@MichaelSun90 I think the naming here is a bit confusing. The custom socket feature we provide won't work with this, as the custom socket feature expects a Node.js Stream compatible stream to be returned, whereas this connect specification builds on top of web streams, which are not directly compatible.

from tedious.

jdanyow avatar jdanyow commented on September 22, 2024

Heard from the Cloudflare folks there's an ongoing effort to make the connect() API standard across runtimes, including Node.js.

Spec: https://github.com/wintercg/proposal-sockets-api
Node implementation: https://github.com/Ethan-Arrowood/socket (published to npm here)

There's a few more weeks of work to polish these up, and further time to improve them based on feedback, but the intent is to make it easier for libraries to start using the connect() API — even before it's provided out-of-the-box in Node.js itself.

from tedious.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.