Skip to content
Permalink
Browse files

Refactoring

  • Loading branch information...
y2k2mt committed Nov 12, 2018
1 parent 7fcaac8 commit 19618a7b7907f1dae425c57dc9e8158fbebe5dc0
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/sse.cr
@@ -5,6 +5,8 @@ module HTTP::ServerSentEvents

class EventSource

@@default_retry_duration : Int64 = 3000.to_i64

record EventMessage, event : String, datas : Array(String), id : String, retry : Int64

def initialize(host : String, path : String, port : Int32, tls = false, headers : HTTP::Headers = HTTP::Headers.new)
@@ -44,7 +46,7 @@ module HTTP::ServerSentEvents
HTTP::Client.get(uri, headers: prepare_headers(last_id)) do |response|
case response.status_code
when 200
retry = 0.to_i64
retry = @@default_retry_duration
an_entry = [] of String
io = response.try &.body_io
loop do

0 comments on commit 19618a7

Please sign in to comment.
You can’t perform that action at this time.