{"id":18546432,"url":"https://github.com/adroll/spillway","last_synced_at":"2025-09-03T19:32:47.535Z","repository":{"id":32914307,"uuid":"140616026","full_name":"AdRoll/spillway","owner":"AdRoll","description":"An Erlang OTP application for load shedding","archived":false,"fork":false,"pushed_at":"2024-07-01T00:15:07.000Z","size":69,"stargazers_count":27,"open_issues_count":1,"forks_count":3,"subscribers_count":14,"default_branch":"main","last_synced_at":"2024-12-23T20:11:38.124Z","etag":null,"topics":["erlang","hacktoberfest"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/spillway","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/AdRoll.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-07-11T18:48:04.000Z","updated_at":"2023-08-31T10:51:50.000Z","dependencies_parsed_at":"2024-01-23T13:25:04.218Z","dependency_job_id":"d4675d4d-a6bc-44bf-abcf-af57f4ff87f2","html_url":"https://github.com/AdRoll/spillway","commit_stats":{"total_commits":65,"total_committers":5,"mean_commits":13.0,"dds":"0.46153846153846156","last_synced_commit":"556ecf66599c9ee8fd8ebbf2ec8f6f5543921ea8"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdRoll%2Fspillway","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdRoll%2Fspillway/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdRoll%2Fspillway/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AdRoll%2Fspillway/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AdRoll","download_url":"https://codeload.github.com/AdRoll/spillway/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231913890,"owners_count":18445013,"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":["erlang","hacktoberfest"],"created_at":"2024-11-06T20:24:57.474Z","updated_at":"2025-09-03T19:32:47.504Z","avatar_url":"https://github.com/AdRoll.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"Overview\n--------------\n\nSpillway is an Erlang OTP application used for load shedding. The idea behind spillway is to use it\nto be able to limit the number of in flight concurrent calls to a section of code.\n\nSome examples:\n - As a server you can use spillway to limit the number of concurrent running requests to a service. You can\n determine when to throw away some requests by considering each request type and its weight.\n A request weight is measured by the cost fo performing the work (CPU/MEMORY) and the cost to not perform\n the work (BUSSINESS IMPACT).\n - As a client, when you face a failing server you might choose to retry a request. Spillway will let you\n implement a simple controlled-in-size-buffer mechanism that will allow you to retry some of the requests without\n running out of memory or resources.\n\nExample of use\n----------------\n\nA process about to execute a named section of code whose maximum parallelism\nshould be limited will call `spillway:enter/2/3` with the name, the weight, and limit.\n\nIf the return value is the 2-tuple `{true, TotalWeight}`, the process may enter the section of code\n (there now being TotalWeight in use concurrently-executing accesses), and otherwise not.\n\nIf the process entered the section of code, it should call `spillway:leave/2` with the name and weight\nafter completion.\n\nNo special arrangement is made to handle process exits.  If a process dies without\ncalling `spillway:leave/1`, the counter will be inaccurate.  This is intentional,\nand callers should make arrangements to mitigate this occurrence.\n\n```\ncase spillway:enter(running_requests, Weight, Limit) of\n {true, Value} -\u003e\n        try\n           continue_executing(Something);\n        after\n            spillway:leave(running_requests, Weight)\n        end;\n false -\u003e\n     discard(Something)\n\nend.\n\n```\n\nSetup\n-------\n\n- Add the application to your rebar3 dependencies and start the application normally.\nAlternatively you can also attach the supervision tree directly to the main supervisor of your\napplication.\n\nImplementation\n----------------\nSpillway is implemented based on ETS-based bounded named counters.\n\n\nBuild\n-----\n\n```shell\n  make\n  make ct\n```\n\n1.x Changelog\n-------------\n1.1 2018-07-13\n * Remove the need to initialize counters\n1.0.0 2018-07-11\n * Add initial implementation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadroll%2Fspillway","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadroll%2Fspillway","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadroll%2Fspillway/lists"}