limit

package
v0.0.0-...-0345585 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2014 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package limit provides an Image Processor that limits the number of concurrent executions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(processor imageserver.Processor, limit uint) imageserver.Processor

New creates a LimitProcessor

Types

type LimitProcessor

type LimitProcessor struct {
	imageserver.Processor
	LimitChan chan struct{}
}

LimitProcessor represents an Image Processor that limits the number of concurrent executions

It wraps an Image Processor and use a buffered channel to limit the number of concurrent executions.

func (*LimitProcessor) Process

func (processor *LimitProcessor) Process(image *imageserver.Image, parameters imageserver.Parameters) (*imageserver.Image, error)

Process forwards the call to the wrapped Image Processor and limits the number of concurrent executions

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL