Skip to content
This repository was archived by the owner on May 5, 2020. It is now read-only.
This repository was archived by the owner on May 5, 2020. It is now read-only.

Add subscriptions for connection opened and connection closed.  #14

Open
@bgourlie

Description

@bgourlie

I believe this would solve #10

There are a number of reasons we would want to know when a connection is established or closed:

Hypothetical not-well-vetted API:

type RetryInfo
     = NoRetry     -- Will not attempt to re-establish the connection
     | RetryIn Int -- Will attempt to re-establish the connection in the specified number of seconds

type alias ConnectionClosedHandler msg 
    = String    -- Connection URI
   -> Int       -- CloseEvent code
   -> RetryInfo -- Retry information
   -> msg

connectionClosed : ConnectionClosedHandler -> Sub msg

connectionOpened : (String -> msg) -> Sub msg

I wouldn't mind taking a stab at implementing this, assuming I can get some feedback on the proposed API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions