GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - subvisual/http_stream: A tiny tiny Elixir library to stream big big files

BranchesTags
Open more actions menu

Latest commit

 

History

37 Commits
37 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
bin
bin
 
 
config
config
 
 
lib
lib
 
 
test
test
 
 
.credo.exs
.credo.exs
 
 
.dialyzer_ignore.exs
.dialyzer_ignore.exs
 
 
.formatter.exs
.formatter.exs
 
 
.gitignore
.gitignore
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
mix.exs
mix.exs
 
 
mix.lock
mix.lock
 
 

Repository files navigation

HTTPStream

Build

HTTPStream is a tiny, tiny package that wraps HTTP requests into a Stream so that you can manage data on the fly, without keeping everything in memory.

Downloading an image:

HTTPStream.get(large_image_url)
|> Stream.into(File.stream!("large_image.png"))
|> Stream.run()

Streaming multiple images into a ZIP archive (using zstream)

[
  Zstream.entry("a.png", HTTPStream.get(a_url))
  Zstream.entry("b.png", HTTPStream.get(b_url))
]
|> Zstream.zip()
|> Stream.into(File.stream!("archive.zip"))
|> Stream.run()

Table of Contents

  • Installation
  • Development
  • Contributing
  • About

Installation

First, you need to add http_stream to your list of dependencies on mix.exs:

def deps do
  [
    {:http_stream, "~> 1.0.0"},

    # if using the Mint adapter:
    {:castore, "~> 0.1.7"},
    {:mint, "~> 1.1.0"}

    # if using the HTTPoison adapter:
    {:httpoison, "~> 1.7.0"}
  ]
end

HTTPStream comes with two adapters: Mint and HTTPoison. By default Mint is configured but you need to include it in your dependencies.

To use HTTPoison, set in your config/config.exs:

config :http_stream, adapter: HTTPStream.Adapter.HTTPoison

That's it! For more intricate API details, refer to the documentation.

Development

If you want to setup the project for local development, you can just run the following commands.

git clone [email protected]:subvisual/http_stream.git
cd http_stream
bin/setup

PRs and issues welcome.

Contributing

Feel free to contribute!

If you found a bug, open an issue. You can also open a PR for bugs or new features. Your PRs will be reviewed and subjected to our styleguide and linters.

All contributions must follow the Code of Conduct and Subvisual's guides.

About

HTTPStream is maintained with ❤️ by Subvisual.


Subvisual

About

A tiny tiny Elixir library to stream big big files

Topics

hacktoberfesthttphttp-clienthttp-streamhttp-streaminghttpclienthttpstreamstreaming

Resources

Readme
ISC license

Code of conduct

Code of conduct
Activity
Custom properties

Stars

19 stars

Watchers

1 watching

Forks

14 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.