Skip to content

cwc/eventsource_ex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Elixir EventSource (Server-Sent Events) client

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages