-
Notifications
You must be signed in to change notification settings - Fork 187
Closures in FieldInfo make it impossible to send some message representations to isolates #167
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
Comments
cc @szakarias |
We are working on removing these closures from the messages. |
That was not entirely true. The closure is still there in the makeDefault. |
It's stopping me from using protocol buffers with Flutter. |
If you're using isolates: A stop-gap for this would be to serialize to bytes before sending and deserialize on the receiving side. |
That doesn't help though if you use isolates to avoid ui hick-ups when parsing :) |
That's a considerable disadvantage. If serialization or deserialization costs more than 16ms, there is no way to avoid UI-freezes. |
Any updates on this? @sigurdm |
No unfortunately. |
Came here for same reason... :( |
I'll try to take a stab at this with #450 |
@mkustermann, I think this can be closed? |
@mit-mit This hasn't been published yet - not even as a dev release. |
Ah, got it, thanks! |
any news? |
The changes I made are included in the It appears like @peterweb2005 Have you tried using those versions? |
Sorry, will late home today, I recall that this year flutter & dart had big update, Then few days ago, from now,, I just tried to migrate that parse process to compute, |
We have a test checked into the protobuf repository that tests sending protos via @peterweb2005 If it doesn't work for you, could I ask you to make a small reproduction, so we can investigate? |
Used the latest libaries: and generated dart data file has no change, ie: has "closure" |
D:\peter\w_dart\protobuf\protoc_plugin>dart test/send_protos_via_sendports_test.dart 00:00 +1: Map-using proto can be transferred via ports 00:00 +2: All tests passed |
edit i tested, because i mistakenly thought the closure in protobuf data files cause the error |
This issue was fixed with #450 and the changes were released with protobuf-2.0.0 and protoc_plugin-20.0.0. |
I got the following error message when I tried to send a protobuf message to an isolate:
This surprised me because I had previously been able to send other message representations. Looking more closely, I found that the error only occurred for my messages with
repeated
fields, and looking into the representation ofFieldInfo
I think I see why: because this field and the ones following it store functions for various special cases, including repeated fields.Here is my test program:
My protos are in
sample.proto
:When I remove the
repeated
keyword from thekiosks_ids
field in my proto, my test program runs successfully:I'm new to Dart, so I'm not sure that sending structs into isolates is a good practice (due to possible efficiency problems), but it seems bad for this to work for some protobuf messages and not others.
The text was updated successfully, but these errors were encountered: