{"id":15605136,"url":"https://github.com/ostinelli/cowbell","last_synced_at":"2025-04-26T15:16:57.628Z","repository":{"id":57486068,"uuid":"58385823","full_name":"ostinelli/cowbell","owner":"ostinelli","description":"An Erlang node connection manager.","archived":false,"fork":false,"pushed_at":"2017-10-18T08:34:53.000Z","size":20,"stargazers_count":26,"open_issues_count":2,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-15T15:50:04.113Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ostinelli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-09T15:07:38.000Z","updated_at":"2024-02-05T13:10:41.000Z","dependencies_parsed_at":"2022-09-18T18:04:26.066Z","dependency_job_id":null,"html_url":"https://github.com/ostinelli/cowbell","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ostinelli%2Fcowbell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ostinelli%2Fcowbell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ostinelli%2Fcowbell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ostinelli%2Fcowbell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ostinelli","download_url":"https://codeload.github.com/ostinelli/cowbell/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250797548,"owners_count":21488931,"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-10-03T04:02:33.128Z","updated_at":"2025-04-25T10:27:14.245Z","avatar_url":"https://github.com/ostinelli.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/ostinelli/cowbell.svg?branch=master)](https://travis-ci.org/ostinelli/cowbell)\n[![Hex pm](https://img.shields.io/hexpm/v/cowbell.svg)](https://hex.pm/packages/cowbell)\n\n# Cowbell\n**Cowbell** is an Erlang node connection manager.\n\n\n## Introduction\nErlang nodes do not automatically reconnect when a node gets disconnected. For instance, when net splits happen, the nodes in a cluster might get disconnected and action needs to be taken to reconnect them again.\n\nCowbell automatically manages the connections \u0026 reconnections for you.\n\n\n## Install\n\n### Rebar3\nIf you're using [rebar3](https://github.com/erlang/rebar3), add `cowbell` as a dependency in your project's `rebar.config` file:\n\n```erlang\n{cowbell, {git, \"git://github.com/ostinelli/cowbell.git\", {tag, \"1.0.1\"}}}\n```\n\nOr, if you're using [Hex.pm](https://hex.pm/) as package manager (with the [rebar3_hex](https://github.com/hexpm/rebar3_hex) plugin):\n\n```erlang\n{cowbell, \"1.0.1\"}\n```\n\nThen, compile:\n\n```bash\n$ rebar3 compile\n```\n\n## Usage\n\n### Setup\nEnsure that Cowbell is started from your application. This can be done by either providing it as a dependency in your `.app` file, or by starting it manually:\n\n```erlang\ncowbell:start().\n```\n\n### Specify Nodes \u0026 Options\nNodes and options can be set in the environment variable `cowbell`. You're probably best off using an application configuration file (in releases, `sys.config`):\n\n```erlang\n{cowbell, [\n\n    %% check interval for nodes events (Default: 10)\n    %% {check_interval_sec, 10},\n\n    %% abandon a node after unsuccessful reconnect (Default: 86400)\n    %% {abandon_node_after_sec, 86400},\n\n    %% list of nodes to connect to and monitor\n    {nodes, [\n        %% 'cowbell@127.0.0.1'\n    ]}\n\n]}.\n```\n\nYour application will have its own logic on when to connect to the other nodes in the cluster. To connect to the nodes and start monitoring for disconnections, issue:\n\n```erlang\ncowbell:connect_nodes().\n```\nA possible place to do so is in the `start/2` function in your main application module, something along the lines of:\n\n```erlang\n-module(myapp_app).\n-behaviour(application).\n\n-export([start/2, stop/1]).\n\nstart(_StartType, _StartArgs) -\u003e\n    %% connect to nodes\n    cowbell:connect_nodes(),\n    %% start sup\n    myapp_sup:start_link().\n```\n\nCowbell will then start monitoring nodes.\n\n\u003e You may prefer to initialize Cowbell inside of the root supervisor instead. This is particularly true if you are using OTP's `included_applications` feature.\n\n## Why \"Cowbell\"?\n_\"A cow bell or cowbell is a bell worn by freely roaming livestock, making animals easier to locate should they wander off.\"_\n- From [Wikipedia](https://en.wikipedia.org/wiki/Cowbell).\n\n\n## Contributing\nSo you want to contribute? That's great! Please follow the guidelines below. It will make it easier to get merged in.\n\nBefore implementing a new feature, please submit a ticket to discuss what you intend to do. Your feature might already be in the works, or an alternative implementation might have already been discussed.\n\nDo not commit to master in your fork. Provide a clean branch without merge commits. Every pull request should have its own topic branch. In this way, every additional adjustments to the original pull request might be done easily, and squashed with `git rebase -i`. The updated branch will be visible in the same pull request, so there will be no need to open new pull requests when there are changes to be applied.\n\nEnsure that you include proper testing. To run tests you simply have to be in the project's root directory and run:\n\n```bash\n$ make tests\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fostinelli%2Fcowbell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fostinelli%2Fcowbell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fostinelli%2Fcowbell/lists"}