gr

package
v1.7.8 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

*

  • Copyright 2020 gd Author. All rights reserved.
  • Author: Chuck1024

*

  • Copyright 2020 gd Author. All rights reserved.
  • Author: Chuck1024

Index

Constants

This section is empty.

Variables

View Source
var TIMTOUR_Err = fmt.Errorf("insert into gouroutine pool timeout")

Functions

This section is empty.

Types

type FixedGoroutinePool

type FixedGoroutinePool struct {
	Size int64
	// contains filtered or unexported fields
}

func (*FixedGoroutinePool) Close

func (f *FixedGoroutinePool) Close()

func (*FixedGoroutinePool) Execute

func (f *FixedGoroutinePool) Execute(function func())

func (*FixedGoroutinePool) ExecuteWithArg

func (f *FixedGoroutinePool) ExecuteWithArg(function func(args ...interface{}), arg ...interface{})

func (*FixedGoroutinePool) Start

func (f *FixedGoroutinePool) Start() error

type FixedGoroutinePoolTimeout

type FixedGoroutinePoolTimeout struct {
	Size    int64
	Timeout time.Duration
	// contains filtered or unexported fields
}

func (*FixedGoroutinePoolTimeout) Close

func (f *FixedGoroutinePoolTimeout) Close()

func (*FixedGoroutinePoolTimeout) Execute

func (f *FixedGoroutinePoolTimeout) Execute(function func()) error

func (*FixedGoroutinePoolTimeout) Start

func (f *FixedGoroutinePoolTimeout) Start() error

type GoRoutinePoolWithConfig

type GoRoutinePoolWithConfig struct {
	DefaultSize    int64
	ReservedConfig map[string]int64
	// contains filtered or unexported fields
}

func (*GoRoutinePoolWithConfig) Close

func (g *GoRoutinePoolWithConfig) Close()

func (*GoRoutinePoolWithConfig) ExecuteDefault

func (g *GoRoutinePoolWithConfig) ExecuteDefault(function func())

func (*GoRoutinePoolWithConfig) ExecuteKey

func (g *GoRoutinePoolWithConfig) ExecuteKey(key string, function func())

func (*GoRoutinePoolWithConfig) Start

func (g *GoRoutinePoolWithConfig) Start() error

type StopableTask

type StopableTask interface {
	Close()
}

* Notice: 1. it use lock to make sure taskList is correct. performance is bad 2. still able to add task after WaitStopAll, so you should make sure no extra task is running after called WaitStopAll

type StopableTaskGroup

type StopableTaskGroup struct {
	// contains filtered or unexported fields
}

func NewStopableTaskGroup

func NewStopableTaskGroup() *StopableTaskGroup

func (*StopableTaskGroup) AddTask

func (s *StopableTaskGroup) AddTask(task StopableTask)

func (*StopableTaskGroup) Close

func (s *StopableTaskGroup) Close()

func (*StopableTaskGroup) Start

func (s *StopableTaskGroup) Start() error

func (*StopableTaskGroup) WaitStopAll

func (s *StopableTaskGroup) WaitStopAll()

Jump to

Keyboard shortcuts

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