Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
52b49427
Unverified
Commit
52b49427
authored
Sep 09, 2021
by
LongCatIsLooong
Committed by
GitHub
Sep 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document FIFO ordering guarantee (#89441)
parent
a14be9d2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
binding.dart
packages/flutter/lib/src/services/binding.dart
+9
-1
platform_channel.dart
packages/flutter/lib/src/services/platform_channel.dart
+13
-0
No files found.
packages/flutter/lib/src/services/binding.dart
View file @
52b49427
...
...
@@ -67,8 +67,11 @@ mixin ServicesBinding on BindingBase, SchedulerBinding {
/// This is used to send messages from the application to the platform, and
/// keeps track of which handlers have been registered on each channel so
/// it may dispatch incoming messages to the registered handler.
///
/// The default implementation returns a [BinaryMessenger] that delivers the
/// messages in the same order in which they are sent.
BinaryMessenger
get
defaultBinaryMessenger
=>
_defaultBinaryMessenger
;
late
BinaryMessenger
_defaultBinaryMessenger
;
late
final
BinaryMessenger
_defaultBinaryMessenger
;
/// The low level buffering and dispatch mechanism for messages sent by
/// plugins on the engine side to their corresponding plugin code on
...
...
@@ -94,6 +97,11 @@ mixin ServicesBinding on BindingBase, SchedulerBinding {
/// Creates a default [BinaryMessenger] instance that can be used for sending
/// platform messages.
///
/// Many Flutter framework components that communicate with the platform
/// assume messages are received by the platform in the same order in which
/// they are sent. When overriding this method, be sure the [BinaryMessenger]
/// implementation guarantees FIFO delivery.
@protected
BinaryMessenger
createBinaryMessenger
()
{
return
const
_DefaultBinaryMessenger
.
_
();
...
...
packages/flutter/lib/src/services/platform_channel.dart
View file @
52b49427
...
...
@@ -27,6 +27,10 @@ import 'message_codecs.dart';
/// The logical identity of the channel is given by its name. Identically named
/// channels will interfere with each other's communication.
///
/// All [BasicMessageChannel]s provided by the Flutter framework guarantee FIFO
/// ordering. Applications can assume messages sent via a built-in
/// [BasicMessageChannel] are delivered in the same order as they're sent.
///
/// See: <https://flutter.dev/platform-channels/>
class
BasicMessageChannel
<
T
>
{
/// Creates a [BasicMessageChannel] with the specified [name], [codec] and [binaryMessenger].
...
...
@@ -95,6 +99,13 @@ class BasicMessageChannel<T> {
/// The logical identity of the channel is given by its name. Identically named
/// channels will interfere with each other's communication.
///
/// {@template flutter.services.method_channel.FIFO}
/// All [MethodChannel]s provided by the Flutter framework guarantee FIFO
/// ordering. Applications can assume method calls sent via a built-in
/// [MethodChannel] are received by the platform plugins in the same order as
/// they're sent.
/// {@endtemplate}
///
/// See: <https://flutter.dev/platform-channels/>
class
MethodChannel
{
/// Creates a [MethodChannel] with the specified [name].
...
...
@@ -412,6 +423,8 @@ class MethodChannel {
///
/// When [invokeMethod] fails to find the platform plugin, it returns null
/// instead of throwing an exception.
///
/// {@macro flutter.services.method_channel.FIFO}
class
OptionalMethodChannel
extends
MethodChannel
{
/// Creates a [MethodChannel] that ignores missing platform plugins.
const
OptionalMethodChannel
(
String
name
,
[
MethodCodec
codec
=
const
StandardMethodCodec
(),
BinaryMessenger
?
binaryMessenger
])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment