{"id":19401695,"url":"https://github.com/mrgravity817/seq-genserver","last_synced_at":"2026-05-12T23:38:49.779Z","repository":{"id":41190870,"uuid":"507898153","full_name":"MRGRAVITY817/seq-genserver","owner":"MRGRAVITY817","description":"Basic Elixir OTP server using GenServer as a sub-behaviour","archived":false,"fork":false,"pushed_at":"2022-06-29T15:02:56.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-24T23:43:58.093Z","etag":null,"topics":["elixir","erlang","erlang-otp","genserver"],"latest_commit_sha":null,"homepage":"","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/MRGRAVITY817.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}},"created_at":"2022-06-27T12:22:57.000Z","updated_at":"2022-06-27T12:23:54.000Z","dependencies_parsed_at":"2022-09-13T09:52:25.911Z","dependency_job_id":null,"html_url":"https://github.com/MRGRAVITY817/seq-genserver","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MRGRAVITY817/seq-genserver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MRGRAVITY817%2Fseq-genserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MRGRAVITY817%2Fseq-genserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MRGRAVITY817%2Fseq-genserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MRGRAVITY817%2Fseq-genserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MRGRAVITY817","download_url":"https://codeload.github.com/MRGRAVITY817/seq-genserver/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MRGRAVITY817%2Fseq-genserver/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281689345,"owners_count":26544619,"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","status":"online","status_checked_at":"2025-10-29T02:00:06.901Z","response_time":59,"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","erlang-otp","genserver"],"created_at":"2024-11-10T11:19:29.538Z","updated_at":"2025-10-29T20:09:33.848Z","avatar_url":"https://github.com/MRGRAVITY817.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sequence\n\nA simple elixir server that increments the integer every time when client calls the server. Education-purpose project from the book _Programming Elixir_ by Dave Thomas.\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\n## Usage\n```bash\n$ iex -S mix\n\n# Start link with server\niex(1)\u003e Sequence.Server.start_link 100\n{:ok, #PID\u003c0.151.0\u003e}\n\n# increment number from 100 -\u003e 101\niex(2)\u003e Sequence.Server.next_number   \n100\n\n# increment number from 101 -\u003e 102\niex(3)\u003e Sequence.Server.next_number\n101\n\n# add number 50\niex(4)\u003e Sequence.Server.increment_number 50\n:ok\n\niex(5)\u003e Sequence.Server.next_number        \n152\n\niex(6)\u003e Sequence.Server.next_number\n153\n```\n\n## Debugging options\nWith `:trace` option,\n```bash\niex(2)\u003e GenServer.start_link(Sequence.Server, 100, [debug: [:trace]])\n{:ok, #PID\u003c0.186.0\u003e}\n\niex(3)\u003e GenServer.call(pid, :next_number)\n*DBG* \u003c0.186.0\u003e got call next_number from \u003c0.183.0\u003e\n*DBG* \u003c0.186.0\u003e sent 100 to \u003c0.183.0\u003e, new state 101\n100     \n```\n\nWith `:statistics` option\n```elixir\niex(5)\u003e {:ok, pid} = GenServer.start_link(Sequence.Server, 100, [debug: [:statistics]])\n{:ok, #PID\u003c0.190.0\u003e}\n\niex(6)\u003e GenServer.call(pid, :next_number)                                              \n100     \n\niex(7)\u003e GenServer.call(pid, :next_number)                                              \n101     \n\niex(8)\u003e :sys.statistics pid, :get\n{:ok,   \n [\n   start_time: {{2022, 6, 28}, {9, 40, 38}},\n   current_time: {{2022, 6, 28}, {9, 41, 2}},\n   reductions: 99,\n   messages_in: 2,\n   messages_out: 2\n ]}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrgravity817%2Fseq-genserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrgravity817%2Fseq-genserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrgravity817%2Fseq-genserver/lists"}