{"id":22359075,"url":"https://github.com/bwireman/glow_server","last_synced_at":"2026-02-07T01:31:11.794Z","repository":{"id":113982087,"uuid":"400845995","full_name":"bwireman/glow_server","owner":"bwireman","description":"Defines macros to use GenServers where the core logic is defined in Gleam","archived":false,"fork":false,"pushed_at":"2022-02-22T23:53:41.000Z","size":9,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-09T14:05:06.804Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/bwireman.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":"2021-08-28T17:00:57.000Z","updated_at":"2022-10-05T18:27:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"db4b17f9-ecba-4799-aee9-88d8ca41dcb5","html_url":"https://github.com/bwireman/glow_server","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bwireman/glow_server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwireman%2Fglow_server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwireman%2Fglow_server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwireman%2Fglow_server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwireman%2Fglow_server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bwireman","download_url":"https://codeload.github.com/bwireman/glow_server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwireman%2Fglow_server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29183946,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T00:44:15.062Z","status":"ssl_error","status_checked_at":"2026-02-07T00:35:01.758Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-12-04T15:19:24.285Z","updated_at":"2026-02-07T01:31:11.779Z","avatar_url":"https://github.com/bwireman.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GlowServer\n\nDefines macros to use GenServers where the core logic is defined in Gleam\n\n## Usage\n\n```elixir\n# elixir server API \ndefmodule ExampleGlowServer do\n  use GlowServer, server: :example\n\n  def start_link(_), do: GenServer.start_link(__MODULE__, \"initial-state\", name: __MODULE__)\n\n  def init(init_arg), do: {:ok, init_arg}\n\n  def read(), do: call(__MODULE__, :read)\n\n  def reverse(), do: cast(__MODULE__, :reverse)\n\n  def clear(), do: set(\"\")\n\n  def set(s), do: cast(__MODULE__, {:set, s})\n\n  def concat(s), do: call(__MODULE__, {:concat, s})\nend\n```\n\nThe `GlowServer.__using__` macro takes in the name of the implementing server and defines \n`call` \u0026 `cast` which are forwarded to the server's `dispatch` function  \n\n\n```gleam\n// core logic in gleam\nimport glow_server/core\nimport gleam/string\n\npub type Request {\n  Read\n  Reverse\n  Concat(String)\n  Set(String)\n}\n\npub type Response =\n  String\n\npub type State =\n  String\n\npub fn dispatch(\n  request: core.Request(Request, State),\n) -\u003e core.Response(Response, State) {\n  case request {\n    core.Call(Read, state) -\u003e core.build_reply(state, state)\n\n    core.Cast(Reverse, state) -\u003e core.build_noreply(string.reverse(state))\n\n    core.Call(Concat(s), state) -\u003e\n      core.build_reply(string.concat([s, state]), s)\n\n    core.Cast(Set(s), _state) -\u003e core.build_noreply(s)\n  }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbwireman%2Fglow_server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbwireman%2Fglow_server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbwireman%2Fglow_server/lists"}