Giter Club home page Giter Club logo

eventsource_ex's Introduction

EventsourceEx

An Elixir EventSource (Server-Sent Events) client

EventsourceEx on Hex

Installation

Add eventsource_ex to your list of dependencies in mix.exs:

    def deps do
      [{:eventsource_ex, "~> x.x.x"}]
    end

Usage

iex(1)> {:ok, pid} = EventsourceEx.new("https://url.com/stream", stream_to: self)
{:ok, #PID<0.150.0>}
iex(2)> flush
%EventsourceEx.Message{data: "1", event: "message", id: nil}
%EventsourceEx.Message{data: "2", event: "message", id: nil}
%EventsourceEx.Message{data: "3", event: "message", id: nil}
:ok

eventsource_ex's People

Contributors

achinkaiwu avatar adamwight avatar andrewyang96 avatar atibabryan avatar cwc avatar davedoesdev avatar mortezahosseini avatar neilberkman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

eventsource_ex's Issues

Update project on Hex with "fix nil header" and README

Hi, I was using your project, version 1.0.0 from Hex.pm and encountered this error

        ** (MatchError) no match of right hand side value: {:error, {:badarg, [{:hackney_headers_new, :new, 1, [file: '/home/diana
/Project/uni/anul3/ptr/app/deps/hackney/src/hackney_headers_new.erl', line: 47]}, {:hackney, :request, 5, [file: '/home/diana
/Project/uni/anul3/ptr/app/deps/hackney/src/hackney.erl', line: 333]}, {HTTPoison.Base, :request, 6, [file: 'lib/httpoison/base.ex', 
line: 846]}, {HTTPoison, :request!, 5, [file: 'lib/httpoison.ex', line: 156]}, {EventsourceEx, :init, 1, [file: 'lib/eventsource_ex.ex', line: 
30]}, {:gen_server, :init_it, 2, [file: 'gen_server.erl', line: 417]}, {:gen_server, :init_it, 6, [file: 'gen_server.erl', line: 385]}, {:proc_lib, 
:init_p_do_apply, 3, [file: 'proc_lib.erl', line: 226]}]}}
            (app 0.1.0) lib/server_conn.ex:7: ServerConn.start_link/1
            (stdlib 3.14) supervisor.erl:385: :supervisor.do_start_child_i/3
            (stdlib 3.14) supervisor.erl:371: :supervisor.do_start_child/2
            (stdlib 3.14) supervisor.erl:355: anonymous fn/3 in :supervisor.start_children/2
            (stdlib 3.14) supervisor.erl:1171: :supervisor.children_map/4
            (stdlib 3.14) supervisor.erl:321: :supervisor.init_children/2
            (stdlib 3.14) gen_server.erl:417: :gen_server.init_it/2
            (stdlib 3.14) gen_server.erl:385: :gen_server.init_it/6

Long story short, i fixed the problem, then I saw that there is already a fix for it. Could you bump the version on Hex.pm so that the fix will be available to everyone and update the README, smth like:

def deps do
      [{:eventsource_ex, "~> 1.0.1"}]
end

Thank you.

Next Major version release?

Hi @cwc I'm getting farther along in my project and I'm wondering if you have plans to release the next version as I'd like to point to the upstream project instead of my fork.
I'm very well aware that:

  1. I have no idea how busy you are.
  2. I have no idea how much work this for you on your end.

I am willing to help in any way that's not a security risk and realize you are an unpaid maintainer so I'm not trying to be a spoiled open source brat.
Thanks for making the only client side http streaming library I know of for elixir and cheers. ๐Ÿป

Update httpoison dep

When I compile eventsource_ex, I get the following warnings:

===> Compiling hackney
src/hackney_pool.erl:213: Warning: crypto:rand_bytes/1 is deprecated and will be removed in a future release; use crypto:strong_rand_bytes/1

src/hackney_multipart.erl:271: Warning: random:uniform/1: the 'random' module is deprecated; use the 'rand' module instead

I think the first one at least is definitely a good reason to upgrade?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.