Documentation

Std.Http.Transport

Transport #

This module exposes a Transport type class that is used to represent different transport mechanisms that can be used with an HTTP connection.

Generic HTTP interface that abstracts over different transport mechanisms.

  • recv : αUInt64Async.Async (Option ByteArray)

    Receive data from the client connection, up to the expected size. Returns None if the connection is closed or no data is available.

  • sendAll : αArray ByteArrayAsync.Async Unit

    Send all data through the client connection.

  • recvSelector : αUInt64Async.Selector (Option ByteArray)

    Get a selector for receiving data asynchronously.

  • close : αIO Unit

    Close the transport connection. The default implementation is a no-op; override this for transports that require explicit teardown. For Socket.Client, the runtime closes the file descriptor when the object is finalized.

Instances
    @[implicit_reducible]
    Equations
    • One or more equations did not get rendered due to their size.

    Mock client endpoint for testing.

    Instances For

      Mock server endpoint for testing.

      Instances For

        Creates a mock server and client that are connected to each other and share the same underlying state, enabling bidirectional communication.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For

          Receives data from a channel, joining all available data up to the expected size. First does a blocking recv, then greedily consumes available data with tryRecv until expect bytes are reached.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For

            Sends a single ByteArray through a channel.

            Equations
            Instances For

              Sends ByteArrays through a channel.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                Creates a selector for receiving from a channel.

                Equations
                Instances For

                  Gets the receive channel for a client (server to client direction).

                  Equations
                  Instances For

                    Gets the send channel for a client (client to server direction).

                    Equations
                    Instances For

                      Sends a single ByteArray.

                      Equations
                      Instances For

                        Receives data, joining all available chunks.

                        Equations
                        Instances For

                          Tries to receive data without blocking, joining all immediately available chunks. Returns none if no data is available.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For

                            Closes the mock server and client.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For

                              Gets the receive channel for a server (client to server direction).

                              Equations
                              Instances For

                                Gets the send channel for a server (server to client direction).

                                Equations
                                Instances For

                                  Sends a single ByteArray.

                                  Equations
                                  Instances For

                                    Receives data, joining all available chunks.

                                    Equations
                                    Instances For

                                      Tries to receive data without blocking, joining all immediately available chunks. Returns none if no data is available.

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For

                                        Closes the mock server and client.

                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For
                                          @[implicit_reducible]
                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          @[implicit_reducible]
                                          Equations
                                          • One or more equations did not get rendered due to their size.