8000 GitHub - mbta/http_stage
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

mbta/http_stage

Repository files navigation

HttpStage

A GenStage Producer which fulfills demand by fetching from an HTTP Server.

Docs

Installation

If available in Hex, the package can be installed by adding http_stage to your list of dependencies in mix.exs:

def deps do
  [
    {:http_stage, "~> 0.2.0"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/http_stage.

Usage

Configure HttpStage with the data URL and any request options as a child of your GenStage Supervisor.

opts = [
  headers: %{"Authorization" => auth_key},
  params: %{verbose: "true"}
]

Supervisor.child_spec(
  {
    HttpStage,
    {"https://example.com/data/source.json", [name: :example_http_data, parser: MyApp.ExampleHttpDataParser] ++ opts}
  },
  id: :example_http_data
)

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages

0