{"id":36920398,"url":"https://github.com/devnw/plex","last_synced_at":"2026-01-12T16:14:48.818Z","repository":{"id":40357772,"uuid":"412669130","full_name":"devnw/plex","owner":"devnw","description":"Plex multiplexes N number of net.Conn objects allowing for connection pooling, self-healing, and auto-scaling of connections.","archived":false,"fork":false,"pushed_at":"2024-12-06T02:58:58.000Z","size":137,"stargazers_count":5,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-06T03:29:01.516Z","etag":null,"topics":["auto-scaling","go","golang","io","network","networking","pooling","quic","self-healing","tcp","udp"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devnw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-02T02:24:24.000Z","updated_at":"2024-12-06T02:58:57.000Z","dependencies_parsed_at":"2024-06-20T00:16:40.407Z","dependency_job_id":null,"html_url":"https://github.com/devnw/plex","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":"devnw/oss-template","purl":"pkg:github/devnw/plex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devnw%2Fplex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devnw%2Fplex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devnw%2Fplex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devnw%2Fplex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devnw","download_url":"https://codeload.github.com/devnw/plex/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devnw%2Fplex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28342376,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T16:14:38.383Z","status":"ssl_error","status_checked_at":"2026-01-12T16:14:34.289Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["auto-scaling","go","golang","io","network","networking","pooling","quic","self-healing","tcp","udp"],"created_at":"2026-01-12T16:14:48.667Z","updated_at":"2026-01-12T16:14:48.804Z","avatar_url":"https://github.com/devnw.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Plex the net.Conn Multiplexer\n\n[![Build \u0026 Test](https://github.com/devnw/plex/actions/workflows/build.yml/badge.svg)](https://github.com/devnw/plex/actions/workflows/build.yml)\n[![Go Report Card](https://goreportcard.com/badge/go.atomizer.io/plex)](https://goreportcard.com/report/go.atomizer.io/plex)\n[![codecov](https://codecov.io/gh/devnw/plex/branch/main/graph/badge.svg)](https://codecov.io/gh/devnw/plex)\n[![Go Reference](https://pkg.go.dev/badge/go.atomizer.io/plex.svg)](https://pkg.go.dev/go.atomizer.io/plex)\n[![License: Apache 2.0](https://img.shields.io/badge/license-Apache-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com)\n\nPlex is a library for managing net.Conn connection types with minimal effort\nthis library utilizes the [options](#options) pattern to allow for easy\nconfiguration and customization of the multiplexer. This library provides\nmultiple types which are used as wrappers to the configured net.Conn types\nwhich allow for general streaming of data through channels of bytes as an\nalternative to the more go traditional io.Reader/io.Writer interfaces.\n\nOne important caveat is that the Plex library makes no assumptions of which\nnet.Conn object is returned from either Reader or Writer. This means that\nmessages must be routed by the consumer based on the data in the message\nrather than assuming that a response to a received message will be sent to\nthe same connection which initiated the message round trip transmission.\n\nThe goal of this library is to abstract the complexity of managing multiple\nconnections and their associated channels of data into a single API which\nconsumers can request Reader and Writer types from. These types implement\nthe io.Closer method which will re-queue the Reader or Writer to the correct\ninternal buffer within the multiplexer for another consumer down the line.\n\n## Installation\n\n```bash\ngo get -u go.atomizer.io/plex@latest\n```\n\n## Usage\n\nPlex uses the options pattern to allow for users to configure the multiplexer.\nFor a full list of options see the [options](#options) documentation.\n\n```go\nimport \"go.atomizer.io/plex\"\n\n...\n\nm, err := plex.New(\n    ctx, \n    plex.WithConnections(\n        mynetconn1,\n        mynetconn2,\n        mynetconnN,\n    ),\n)\n\n// Access a plex.Reader\nr, err := m.Reader(ctx, timeout)\n\n// Access a plex.Writer\nw, err := m.Writer(ctx, timeout)\n\n```\n\nUsers are responsible for closing any plex.Readers/plex.Writers they acquire\nfrom the multiplexer. If they are not closed they will not be returned to the\nmultiplexer pool for reuse.\n\nFor further options and documentation visit our documentation page using the\ndocs badge at the top of the README.\n\n## Options\n\nAvailble configuration options include the following:\n\nNOTE: For the full documentation see [Options](https://pkg.go.dev/go.atomizer.io/plex#Option)\n\n### `WithConnections(connections ...net.Conn)`\n\nAdds a pre-configured list of net.Conn objects to the multiplexer. This option\nalso sets the internal buffer size to the number of the Multiplexer when NOT\nused in conjunction with the `WithMaxCapacity` option.\n\nNOTE: Buffer size of the multiplexer does NOT change for the lifetime of the\nmultiplexer.\n\n### `WithMaxCapacity(max int)`\n\nSets a pre-configured maximum capacity for the multiplexer. This max capacity\nwill not change for the lifetime of the multiplexer.\n\n### `WithConnector(c Connect)`\n\nAllows for the configuration of a custom Connect function. This function has\nthe following signature: `func(ctx context.Context, conn net.Conn) error`. The\nconfiguration of the Connector allows the Multiplexer to re-create failed\nconnections that already exist or to create new connections when using the\n`WithAutoScaling` option.\n\n### `WithAutoScaling(timeout time.Duration)`\n\nConfigures an internal timeout within the multiplexer to automatically add new\nconnections to the multiplexer in the event that there are not any available\nconnections in the multiplexer. This option is only available when using the\n`WithConnector` option.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevnw%2Fplex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevnw%2Fplex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevnw%2Fplex/lists"}