Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 699 Bytes

README.md

File metadata and controls

23 lines (16 loc) · 699 Bytes

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