syntax = "proto3";

package temporal.api.sdk.v1;

option go_package = "go.temporal.io/api/sdk/v1;sdk";
option java_package = "io.temporal.api.sdk.v1";
option java_multiple_files = true;
option java_outer_classname = "WorkerConfigProto";
option ruby_package = "Temporalio::Api::Sdk::V1";
option csharp_namespace = "Temporalio.Api.Sdk.V1";

message WorkerConfig {
    message SimplePollerBehavior {
        int32 max_pollers = 1;
    }

    message AutoscalingPollerBehavior {
        // At least this many poll calls will always be attempted (assuming slots are available).
        // Cannot be zero.
        int32 min_pollers = 1;

        // At most this many poll calls will ever be open at once. Must be >= `minimum`.
        int32 max_pollers = 2;

        // This many polls will be attempted initially before scaling kicks in. Must be between
        //  `minimum` and `maximum`.
        int32 initial_pollers = 3;
    }

    int32 workflow_cache_size = 1;

    oneof poller_behavior {
        SimplePollerBehavior simple_poller_behavior = 2;
        AutoscalingPollerBehavior autoscaling_poller_behavior = 3;
    }
}
