Skip to content

feature: poolable messages paths with wildcard #114

Open

Description

There are currently two ways to define messages to which the "pool" functionality will be applied:

  1. Via per-message optionvtproto.mempool
  2. By enumerating messages with the pool flag

Both of these methods uncomfortable to use for large numbers of messages.

It might be worth adding the ability to use wildcards in pool flag to determine group of messages.

For example in my existing buf configuration:

version: v1
plugins:
    - name: go-vtproto
      path: bin/protoc-gen-go-vtproto
      out: .
      opt:
        - features=marshal+unmarshal+size+pool+grpc
        - paths=source_relative
        - pool=github.com/some/api/example1.Message1
        - pool=github.com/some/api/example2.Message2
        - pool=...
        - pool=github.com/some/api/example3.Message100
      strategy: directory

Instead could be:

version: v1
plugins:
    - name: go-vtproto
      path: bin/protoc-gen-go-vtproto
      out: .
      opt:
        - features=marshal+unmarshal+size+pool+grpc
        - paths=source_relative
        - pool=github.com/some/service/api/*
      strategy: directory

For more flexibility it is also possible to add a flag to exclude some messages from pool feature generation (something like pool-exclude).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions