turns out current VerneMQ using newer ranch version (2.1.0) instead of old (1.8.0), and the pattern match failed because newer versin of ranch using new map version of :supervisor.child_spec instead of the old 5/6 elements tuple.
Then I seek Phoenix/Plug implementation, because phoenix runs well on my plugin. I found they're using below approach that returning map version instead of the tuple version
I've just tried to run GRPC server as a plugin in VerneMQ. Then I found an error pointing to
https://github.com/elixir-grpc/grpc/blob/c7ee0c11ad9eb95a8925a342af8e2d5b1f082fee/lib/grpc/server/adapters/cowboy.ex#L45-L46
turns out current VerneMQ using newer
ranch
version (2.1.0
) instead of old (1.8.0
), and the pattern match failed because newer versin ofranch
using new map version of:supervisor.child_spec
instead of the old 5/6 elements tuple.Then I seek Phoenix/Plug implementation, because phoenix runs well on my plugin. I found they're using below approach that returning map version instead of the tuple version
https://github.com/elixir-plug/plug_cowboy/blob/d5b54031fb7fe98b8f2025e51587db988e4dabf0/lib/plug/cowboy.ex#L257-L270
I think it's better for this lib do similar approach, for the sake of compatibility