-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
281 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import 'package:centrifuge_dart/src/model/channel_push.dart'; | ||
|
||
/// {@template connect} | ||
/// Connect push from Centrifugo server. | ||
/// {@endtemplate} | ||
final class CentrifugeConnect extends CentrifugeChannelPush { | ||
/// {@macro connect} | ||
const CentrifugeConnect({ | ||
required super.timestamp, | ||
required super.channel, | ||
required this.client, | ||
required this.version, | ||
required this.data, | ||
this.expires, | ||
this.ttl, | ||
this.pingInterval, | ||
this.sendPong, | ||
this.session, | ||
this.node, | ||
}); | ||
|
||
@override | ||
String get type => 'connect'; | ||
|
||
/// Unique client connection ID server issued to this connection | ||
final String client; | ||
|
||
/// Server version | ||
final String version; | ||
|
||
/// Whether a server will expire connection at some point | ||
final bool? expires; | ||
|
||
/// Time when connection will be expired | ||
final DateTime? ttl; | ||
|
||
/// Client must periodically (once in 25 secs, configurable) send | ||
/// ping messages to server. If pong has not beed received in 5 secs | ||
/// (configurable) then client must disconnect from server | ||
/// and try to reconnect with backoff strategy. | ||
final Duration? pingInterval; | ||
|
||
/// Whether to send asynchronous message when pong received. | ||
final bool? sendPong; | ||
|
||
/// Session ID. | ||
final String? session; | ||
|
||
/// Server node ID. | ||
final String? node; | ||
|
||
/// Payload of connected push. | ||
final List<int> data; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import 'package:centrifuge_dart/src/model/channel_push.dart'; | ||
|
||
/// {@template disconnect} | ||
/// Disconnect push from Centrifugo server. | ||
/// {@endtemplate} | ||
final class CentrifugeDisconnect extends CentrifugeChannelPush { | ||
/// {@macro disconnect} | ||
const CentrifugeDisconnect({ | ||
required super.timestamp, | ||
required super.channel, | ||
required this.code, | ||
required this.reason, | ||
required this.reconnect, | ||
}); | ||
|
||
@override | ||
String get type => 'disconnect'; | ||
|
||
/// Code of disconnect. | ||
final int code; | ||
|
||
/// Reason of disconnect. | ||
final String reason; | ||
|
||
/// Reconnect flag. | ||
final bool reconnect; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import 'package:centrifuge_dart/src/model/channel_push.dart'; | ||
|
||
/// {@template message} | ||
/// Message push from Centrifugo server. | ||
/// {@endtemplate} | ||
final class CentrifugeMessage extends CentrifugeChannelPush { | ||
/// {@macro message} | ||
const CentrifugeMessage({ | ||
required super.timestamp, | ||
required super.channel, | ||
required this.data, | ||
}); | ||
|
||
@override | ||
String get type => 'message'; | ||
|
||
/// Payload of message. | ||
final List<int> data; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import 'package:centrifuge_dart/src/model/channel_push.dart'; | ||
import 'package:centrifuge_dart/src/model/stream_position.dart'; | ||
|
||
/// {@template subscribe} | ||
/// Subscribe push from Centrifugo server. | ||
/// {@endtemplate} | ||
final class CentrifugeSubscribe extends CentrifugeChannelPush { | ||
/// {@macro subscribe} | ||
const CentrifugeSubscribe({ | ||
required super.timestamp, | ||
required super.channel, | ||
required this.positioned, | ||
required this.recoverable, | ||
required this.data, | ||
required this.streamPosition, | ||
}); | ||
|
||
@override | ||
String get type => 'subscribe'; | ||
|
||
/// Whether subscription is positioned. | ||
final bool positioned; | ||
|
||
/// Whether subscription is recoverable. | ||
final bool recoverable; | ||
|
||
/// Data attached to subscription. | ||
final List<int> data; | ||
|
||
/// Stream position. | ||
final CentrifugeStreamPosition? streamPosition; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import 'package:centrifuge_dart/src/model/channel_push.dart'; | ||
|
||
/// {@template unsubscribe} | ||
/// Unsubscribe push from Centrifugo server. | ||
/// {@endtemplate} | ||
final class CentrifugeUnsubscribe extends CentrifugeChannelPush { | ||
/// {@macro unsubscribe} | ||
const CentrifugeUnsubscribe({ | ||
required super.timestamp, | ||
required super.channel, | ||
required this.code, | ||
required this.reason, | ||
}); | ||
|
||
@override | ||
String get type => 'unsubscribe'; | ||
|
||
/// Code of unsubscribe. | ||
final int code; | ||
|
||
/// Reason of unsubscribe. | ||
final String reason; | ||
} |
Oops, something went wrong.