{"id":13507465,"url":"https://github.com/elixir-ecto/connection","last_synced_at":"2025-05-15T15:06:17.083Z","repository":{"id":31825619,"uuid":"35392495","full_name":"elixir-ecto/connection","owner":"elixir-ecto","description":"Connection behaviour for connection processes","archived":false,"fork":false,"pushed_at":"2024-04-26T05:35:48.000Z","size":79,"stargazers_count":265,"open_issues_count":1,"forks_count":23,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-05-14T02:18:32.305Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/connection/Connection.html","language":"Elixir","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/elixir-ecto.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-05-10T23:42:21.000Z","updated_at":"2025-04-11T17:18:45.000Z","dependencies_parsed_at":"2024-05-01T15:27:40.391Z","dependency_job_id":"d15363ac-3259-411d-9dd5-3484cd6162bc","html_url":"https://github.com/elixir-ecto/connection","commit_stats":{"total_commits":63,"total_committers":14,"mean_commits":4.5,"dds":0.3492063492063492,"last_synced_commit":"e17de7e928a3923926df942e1e3575cc5b6f14ad"},"previous_names":["fishcakez/connection"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-ecto%2Fconnection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-ecto%2Fconnection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-ecto%2Fconnection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-ecto%2Fconnection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elixir-ecto","download_url":"https://codeload.github.com/elixir-ecto/connection/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254364270,"owners_count":22058878,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-08-01T02:00:34.338Z","updated_at":"2025-05-15T15:06:17.059Z","avatar_url":"https://github.com/elixir-ecto.png","language":"Elixir","funding_links":[],"categories":["Behaviours and Interfaces"],"sub_categories":[],"readme":"# Connection\n\n*Note:* with the inclusion of [`gen_statem`](https://www.erlang.org/doc/man/gen_statem.html)\nin Erlang/OTP, this project is no longer necessary. See the following pull request as examples\nof replacing `Connection` by `gen_statem` in existing projects:\n\n  * https://github.com/elixir-ecto/postgrex/pull/643\n  * https://github.com/elixir-ecto/postgrex/pull/644\n  * https://github.com/elixir-ecto/db_connection/pull/275\n\nWe may release new versions if necessary to keep compatibility with Erlang/OTP and\nElixir but otherwise this package is no longer recommended for new projects.\n\n---\n\n`Connection` behaviour for connection processes. The API is superset of the\nGenServer API. There are 2 additional callbacks `connect/2` and `disconnect/2`:\n\n```elixir\n  @callback init(any) ::\n    {:ok, any} | {:ok, any, timeout | :hibernate} |\n    {:connect, any, any} |\n    {:backoff, timeout, any} | {:backoff, timeout, any, timeout | :hibernate} |\n    :ignore | {:stop, any}\n\n  @callback connect(any, any) ::\n    {:ok, any} | {:ok, any, timeout | :hibernate} |\n    {:backoff, timeout, any} | {:backoff, timeout, any, timeout | :hibernate} |\n    {:stop, any, any}\n\n  @callback disconnect(any, any) ::\n    {:connect, any, any} |\n    {:backoff, timeout, any} | {:backoff, timeout, any, timeout | :hibernate} |\n    {:noconnect, any} | {:noconnect, any, timeout | :hibernate}\n    {:stop, any, any}\n\n  @callback handle_call(any, {pid, any}, any) ::\n    {:reply, any, any} | {:reply, any, any, timeout | :hibernate} |\n    {:noreply, any} | {:noreply, any, timeout | :hibernate} |\n    {:disconnect | :connect, any, any} |\n    {:disconnect | :connect, any, any, any} |\n    {:stop, any, any} | {:stop, any, any, any}\n\n  @callback handle_cast(any, any) ::\n    {:noreply, any} | {:noreply, any, timeout | :hibernate} |\n    {:disconnect | :connect, any, any} |\n    {:stop, any, any}\n\n  @callback handle_info(any, any) ::\n    {:noreply, any} | {:noreply, any, timeout | :hibernate} |\n    {:disconnect | :connect, any, any} |\n    {:stop, any, any}\n\n  @callback code_change(any, any, any) :: {:ok, any}\n\n  @callback terminate(any, any) :: any\n```\n\nThere is an example of a simple TCP connection process in\n`examples/tcp_connection/`.\n\n\n## License\n\nCopyright 2015 James Fish\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixir-ecto%2Fconnection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felixir-ecto%2Fconnection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixir-ecto%2Fconnection/lists"}