Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/callback messages #220

Merged
merged 4 commits into from
Aug 2, 2019
Merged

Feature/callback messages #220

merged 4 commits into from
Aug 2, 2019

Conversation

pchampio
Copy link
Member

@pchampio pchampio commented Aug 2, 2019

Golang impl of flutter/engine@6aad139

I chose to break the plugin api:

@@ plugin/method-channel.go
-  _, err := MethodChannel.InvokeMethod("popRoute",nil)
+  err := MethodChannel.InvokeMethod("popRoute",nil)
@@ plugin/basic-message-channel.go
-  _, err := BasicMessageChannel.Send("xxx")
+  err = BasicMessageChannel.Send("xxx")

Why?

Peoples are used to not return result in their flutter setMethodCallHandler/setMessageHandler.
example:

  platform_channel
      .setMethodCallHandler((MethodCall methodCall) async {
          // do sutff

          // rarely calls:
          // return "42"; 
  });

With a InvokeMethod that expect a reply, the embedder will wait forever, (not blocking the UI but the behavior isn't normal).

The uses of InvokeMethodWithReply and SendWithReply is enough to let the user know he has to return a value in the flutter handler.

*WithReply is also used in the flutter/engine desktop shell, users will not get lost.

@pchampio
Copy link
Member Author

pchampio commented Aug 2, 2019

I have checked on github, the changes in the plugin api shouldn't affect anyone.

@pchampio pchampio merged commit 05a9c87 into beta Aug 2, 2019
@pchampio pchampio deleted the feature/callback-messages branch August 2, 2019 17:27
@pchampio pchampio mentioned this pull request Aug 2, 2019
pchampio added a commit that referenced this pull request Aug 2, 2019
pchampio added a commit that referenced this pull request Aug 3, 2019
pchampio added a commit that referenced this pull request Aug 3, 2019
pchampio added a commit that referenced this pull request Aug 3, 2019
pchampio added a commit that referenced this pull request Aug 4, 2019
pchampio added a commit that referenced this pull request Aug 4, 2019
pchampio added a commit that referenced this pull request Aug 4, 2019
pchampio added a commit that referenced this pull request Aug 4, 2019
pchampio added a commit that referenced this pull request Aug 4, 2019
pchampio added a commit that referenced this pull request Sep 3, 2019
* Texture support (#217)

* Feature/event loop interop (#218)

* Feature/callback messages (#220)

* fix: remove initial WaitEvent

now that we have implemented the proper event loop.
Delete the first WaitEvent

* lazy initialize go-gl/gl on first texture frame

* align BinaryMessenger with *-channels

BinaryMessenger:
SendNoReply -> Send
Send -> SendWithReply

* change the priorityQueue to specifically contain embedder.FlutterTask's

* Adds comments and renames internals. Also some re-ordering of init code. (#235)

* Addressing comments & fix pointer warning

* implement RunOnCurrentThread check using C call

* Custom error codes on the plugin side (#238)

Custom error codes on the plugin side

* rely on LockOSThread to ensure engine task are run on the same thread
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant