Skip to content
This repository has been archived by the owner on Aug 3, 2019. It is now read-only.

Stateful connections

Mark Paluch edited this page Jul 14, 2015 · 1 revision

spinach's API is separated into a DisqueConnection API and multiple command APIs (sync, async and reactive) to separate connection resources from the particular API. Every API operates on the stateful connection that maintains the state (authentication state for now). This state is restored after the connection reconnects. All async, sync and reactive API's operate on the underlying connection. If you close for example the connection using the sync API, the same connection is no longer usable over the async or reactive API. Multiple connections (multiple calls to connect()) create multiple connections that are isolated from each other.

You can obtain a stateful connection from an existing connection by calling getConnection() on the async, sync, or reactive API.