From e176a54b030dac7f174a22e37eb405c922e500e3 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Tue, 8 Oct 2019 11:45:17 -0700 Subject: [PATCH] add concurrency limit to yaml --- manifest/concur.go | 10 ++++++++++ manifest/concur_test.go | 5 +++++ manifest/manifest.go | 6 ++++++ 3 files changed, 21 insertions(+) create mode 100644 manifest/concur.go create mode 100644 manifest/concur_test.go diff --git a/manifest/concur.go b/manifest/concur.go new file mode 100644 index 0000000..0493bbf --- /dev/null +++ b/manifest/concur.go @@ -0,0 +1,10 @@ +// Copyright 2019 Drone.IO Inc. All rights reserved. +// Use of this source code is governed by the Polyform License +// that can be found in the LICENSE file. + +package manifest + +// Concurrency limits pipeline concurrency. +type Concurrency struct { + Limit int `json:"limit,omitempty"` +} diff --git a/manifest/concur_test.go b/manifest/concur_test.go new file mode 100644 index 0000000..f0f6365 --- /dev/null +++ b/manifest/concur_test.go @@ -0,0 +1,5 @@ +// Copyright 2019 Drone.IO Inc. All rights reserved. +// Use of this source code is governed by the Polyform License +// that can be found in the LICENSE file. + +package manifest diff --git a/manifest/manifest.go b/manifest/manifest.go index db4b54e..2d15d1c 100644 --- a/manifest/manifest.go +++ b/manifest/manifest.go @@ -28,6 +28,12 @@ type ( GetName() string } + // ConcurrentResource is a resource with concurrency limits. + ConcurrentResource interface { + Resource + GetConcurrency() Concurrency + } + // DependantResource is a resoure with runtime dependencies. DependantResource interface { Resource