Object.RobustNetworkTransport (object v0.1.2)

A more robust network transport layer that handles startup failures gracefully.

This module addresses common issues in network startup by:

  • Implementing graceful degradation when transport services fail
  • Providing fallback mechanisms for connection establishment
  • Better error handling and recovery strategies
  • Improved process lifecycle management

Summary

Functions

Returns a specification to start this module under a supervisor.

Connects to a remote endpoint with robust error handling.

Gracefully starts the transport service with fallback options.

Checks if the transport service is available and healthy.

Sends data with automatic retry and fallback mechanisms.

Types

connection_id()

@type connection_id() :: String.t()

connection_opts()

@type connection_opts() :: [
  host: String.t(),
  port: non_neg_integer(),
  transport: transport_type(),
  ssl: boolean(),
  pool_size: pos_integer(),
  timeout: timeout(),
  reconnect_interval: pos_integer(),
  max_reconnect_attempts: pos_integer()
]

connection_state()

@type connection_state() :: :connecting | :connected | :disconnected | :failed

transport_type()

@type transport_type() :: :tcp | :udp | :websocket | :grpc

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

connect(host, port, opts \\ [])

Connects to a remote endpoint with robust error handling.

ensure_started(opts \\ [])

Gracefully starts the transport service with fallback options.

health_check(transport_name \\ __MODULE__)

Checks if the transport service is available and healthy.

send_data(connection_id, data, opts \\ [])

Sends data with automatic retry and fallback mechanisms.

start_link(opts \\ [])