{"id":16547870,"url":"https://github.com/brunojppb/elixir-gen-server","last_synced_at":"2026-05-11T14:33:01.195Z","repository":{"id":67824997,"uuid":"257390850","full_name":"brunojppb/elixir-gen-server","owner":"brunojppb","description":"The simplest GenServer you can imagine. Just to learn OTP.","archived":false,"fork":false,"pushed_at":"2020-05-01T09:09:55.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-04T11:44:27.694Z","etag":null,"topics":["elixir","erlang","otp"],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brunojppb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-04-20T20:03:36.000Z","updated_at":"2020-05-01T09:09:58.000Z","dependencies_parsed_at":"2023-07-18T05:05:33.917Z","dependency_job_id":null,"html_url":"https://github.com/brunojppb/elixir-gen-server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/brunojppb/elixir-gen-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunojppb%2Felixir-gen-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunojppb%2Felixir-gen-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunojppb%2Felixir-gen-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunojppb%2Felixir-gen-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brunojppb","download_url":"https://codeload.github.com/brunojppb/elixir-gen-server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunojppb%2Felixir-gen-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32899009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"online","status_checked_at":"2026-05-11T02:00:05.975Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["elixir","erlang","otp"],"created_at":"2024-10-11T19:23:32.357Z","updated_at":"2026-05-11T14:33:01.177Z","avatar_url":"https://github.com/brunojppb.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OTP GenServer \n\nLearning OTP by doing.\n\n## Installation\n\nIf [available in Hex](https://hex.pm/docs/publish), the package can be installed\nby adding `sequence` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:sequence, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\nRun `iex -S mix` to try it out:\n```elixir\n{:ok, pid} = GenServer.start_link(Sequence.Server, 100)\n# {:ok, #PID\u003c0.151.0\u003e}\niex(2)\u003e GenServer.call(pid, :next_number)                      \n100\niex(3)\u003e GenServer.call(pid, :next_number)\n101\niex(6)\u003e GenServer.call(pid, {:set_number, 455})\n455\niex(7)\u003e GenServer.call(pid, :next_number)      \n455\niex(8)\u003e GenServer.call(pid, :next_number)\n456\n\n# Try the GenServer with debug options\n{:ok,pid} = GenServer.start_link(Sequence.Server, 100, [debug: [:trace, :statistics]])\nGenServer.call(pid, :next_number)\n# *DBG* \u003c0.68.0\u003e got call next_number from \u003c0.25.0\u003e\n# *DBG* \u003c0.68.0\u003e sent 101 to \u003c0.25.0\u003e, new state 102\n101\nGenServer.cast(pid, {:increment_number, 500})\n\n# Check some cool statistics about the server\n:sys.statistics pid, :get\n# You should see an output similar to this:\n{:ok,\n [\n   start_time: {{2020, 4, 21}, {0, 11, 23}},\n   current_time: {{2020, 4, 21}, {0, 12, 30}},\n   reductions: 729,\n   messages_in: 8,\n   messages_out: 5\n ]}\n```\n\nDocumentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)\nand published on [HexDocs](https://hexdocs.pm). Once published, the docs can\nbe found at [https://hexdocs.pm/sequence](https://hexdocs.pm/sequence).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrunojppb%2Felixir-gen-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrunojppb%2Felixir-gen-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrunojppb%2Felixir-gen-server/lists"}