Skip to content
This repository was archived by the owner on Nov 14, 2017. It is now read-only.

Rejoin behavior and promises #4

@akeating

Description

@akeating

Thanks for putting this together. I notice absinthe-phoenix-js relies on the phoenix Socket lib, layering on subscriptions. The main methods return promises (connect, subscribe, unsubscribe). These promises are resolved or rejected based on callback handlers which may fire multiple times. For example, socket.onOpen can fire more than once, re-executing an attempt to create a channel. The underlying behavior causing this is retry/rejoin. Once opened, Socket will attempt to reconnect and rejoin. If the server connection is terminated, Socket will retry/rejoin for you. onClose, onOpen and friends can fire more than once. I would argue that the use of promises are not really a good fit when used on this manner. That said, promises are definitely useful and they could be implemented without directly relying on the callbacks. This lib could also attempt to resubscribe on rejoin. Wondering whether these are known issues and if there is already an effort underway to solve them?

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