Channel<T extends ChannelState> class
abstract
Receives and handles respective events delegated by ChannelsManager
.
Each application can have one channel or many, and each client can choose which channels it subscribes to. Channels provide:
- A way of filtering data For example, in a chat application there may be a channel for people who want to discuss ‘dogs’
- A way of controlling access to different streams of information. For example, a project management application would want to authorize people to get updates about ‘secret-projectX’
Supported channels:
See for more details: Channels docs
- Implementers
- Available extensions
Constructors
- Channel()
Properties
- connectionDelegate → ChannelsManagerConnectionDelegate
-
A delegate that is passed by
ChannelsManager
. Exposes necessary API ofPusherChannelsClientLifeCycleController
.no setter - currentStatus → ChannelStatus?
-
Gives the current status of the state.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
Name of this channel
no setter
- publicEventEmitter → ChannelPublicEventEmitter
-
Delegates a sink of the
ChannelsManager
's StreamController.no setter - publicStreamGetter → ChannelsManagerStreamGetter
-
A atream injection applied by an instance of
ChannelsManager
no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → T?
-
A current state of this channel
no setter
Methods
-
bind(
String eventName) → Stream< ChannelReadEvent> -
Return a stream capturing events with respective
eventName
. -
bindToAll(
) → Stream< ChannelReadEvent> - Returns a stream with all the events captured by this channel.
-
canHandleEvent(
ChannelReadEvent event) → bool -
getStateTest(
) → T? -
getStateWithNewStatus(
ChannelStatus status) → T -
getStateWithNewSubscriptionCount(
int? subscriptionCount) → T -
handleEvent(
ChannelReadEvent event) → void -
Handles events received from an instance of
ChannelsManager
-
handleOtherExternalEvents(
ChannelReadEvent readEvent) → void -
Passes all other events to
ChannelsManager
's instances' sink i.e. - publicEventEmitter -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onAuthenticationSubscriptionFailed(
) → Stream< ChannelReadEvent> -
Available on Channel<
T> , provided by the ChannelExtension extension -
onSubscriptionError(
{String? errorType}) → Stream< ChannelReadEvent> -
Available on Channel<
T> , provided by the ChannelExtension extension -
subscribe(
) → void - Presets this current state with new status - ChannelStatus.pendingSubscription
-
subscribeIfNotUnsubscribed(
) → void - Performs subscription if this channel was not unsubscibed intentionally. Recommended to use while listening for PusherChannelsClient.onConnectionEstablished
-
toString(
) → String -
A string representation of this object.
inherited
-
unsubscribe(
) → void - Presets this current state with new status - ChannelStatus.unsubscribed
-
updateState(
T newState) → void -
whenSubscriptionSucceeded(
) → Stream< ChannelReadEvent> -
Available on Channel<
T> , provided by the ChannelExtension extension
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
Constants
- authErrorTypeString → const String
- decryptionErrorTypeString → const String
- internalMemberAddedEventName → const String
- internalMemberRemovedEventName → const String
- internalSubscriptionsCountEventName → const String
- internalSubscriptionSucceededEventName → const String
- memberAddedEventName → const String
- memberRemovedEventName → const String
- pusherInternalPrefix → const String
- subscriptionErrorEventName → const String
- subscriptionsCountEventName → const String
- subscriptionsCountKey → const String
- subscriptionSucceededEventName → const String