Skip to content

[pigeon] Task queues should be serial across a HostApi instance #162624

@stuartmorgan-g

Description

@stuartmorgan-g

I had thought that Pigeon's task queue implementation shared a task queue for the entire HostApi, but while looking at some generated code I noticed that each method (each of which is its own channel) is getting its own task queue. That means that calls like:

a(1), b(1), a(2), b(2)

from Dart could execute on the native side as any of:

a(1), b(1), a(2), b(2)

a(1), a(2), b(1), b(2)

b(1), b(2), a(1), a(2)

a(1), b(1), b(2), a(2)

b(1), a(1), a(2), b(2)

That's not what we would want for any use case I can think of, and definitely not for the two cases where our plugins are using them. We should instead make everything in a HostApi share a task queue instance so that we have the same cross-method serialization behavior that we would have without them, just on a non-main thread.

Metadata

Metadata

Labels

P1High-priority issues at the top of the work listp: pigeonrelated to pigeon messaging codegen toolpackageflutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions