Skip to content

Commit

Permalink
Buffer type support added.
Browse files Browse the repository at this point in the history
Example updated (up to date).
  • Loading branch information
sourcecaster committed Jul 10, 2022
1 parent 3da0a43 commit aede70d
Show file tree
Hide file tree
Showing 6 changed files with 510 additions and 226 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v1.2.0
* Added support for binary type (uses Uint8List). Format: binary12, binary64 etc. - any buffer length in bytes.
* Example file is up to date now. (Message constructors require non-optional parameters).

## v1.1.3
* Bugfix: concurrent modifications during iteration occurred in some cases while processing events.

Expand Down
48 changes: 24 additions & 24 deletions example/example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -140,30 +140,30 @@ class MehModule extends Module<MehClient> {
console.on('sendPackedMessage', (_, __) {
/// GetResponse is just the name of response message of command Get.
/// It's declared in example-users.generated.dart.
final GetResponse message = GetResponse()
..email = '${randomString()}@${randomString()}.com'
..nickname = 'Mr. ${randomString()}'
..hidden = false
..created = DateTime.now()
..info = (GetResponseInfo()
..firstName = randomString()
..lastName = randomString()
..age = randomInt()
)
..social = (GetResponseSocial()
..facebookId = randomInt() < 128 ? 'fbID_${randomString()}' : null
..twitterId = randomInt() < 128 ? 'twID_${randomString()}' : null
..instagramId = randomInt() < 128 ? 'inID_${randomString()}' : null
)
..stats = (GetResponseStats()
..posts = randomInt()
..comments = randomInt()
..likes = randomInt() * 10
..dislikes = randomInt()
..rating = randomInt() / 25.5

)
..sessions = <GetResponseSession>[];
final GetResponse message = GetResponse(
email: '${randomString()}@${randomString()}.com',
nickname: 'Mr. ${randomString()}',
hidden: false,
created: DateTime.now(),
info: GetResponseInfo(
firstName: randomString(),
lastName: randomString(),
age: randomInt(),
),
social: GetResponseSocial(
facebookId: randomInt() < 128 ? 'fbID_${randomString()}' : null,
twitterId: randomInt() < 128 ? 'twID_${randomString()}' : null,
instagramId: randomInt() < 128 ? 'inID_${randomString()}' : null,
),
stats: GetResponseStats(
posts: randomInt(),
comments: randomInt(),
likes: randomInt() * 10,
dislikes: randomInt(),
rating: randomInt() / 25.5,
),
sessions: <GetResponseSession>[],
);
server.broadcast(message);
log('Here is the message I sent:', MAGENTA);
messageToStrings(message).forEach(log);
Expand Down
Loading

0 comments on commit aede70d

Please sign in to comment.