Documentation
¶
Index ¶
- func ProcessItem(occurances int, item interface{}, svc IConcurrent) (interface{}, error)
- func ProcessItemSliceString(occurances int, item []string, svc *ConcurrentService) []string
- type ConcurrentService
- func (svc *ConcurrentService) GetServiceStruct() ConcurrentService
- func (svc *ConcurrentService) ProcessConcurrentlySliceInt(item []int, occurances int, ...) ([]int, []error)
- func (svc *ConcurrentService) ProcessConcurrentlySliceStr(item []string, occurances int, ...) ([]string, []error)
- func (svc *ConcurrentService) ProcessSomething(data interface{}) (interface{}, int, error)
- type IConcurrent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProcessItem ¶
func ProcessItem(occurances int, item interface{}, svc IConcurrent) (interface{}, error)
func ProcessItemSliceString ¶
func ProcessItemSliceString(occurances int, item []string, svc *ConcurrentService) []string
ProcessItem process slice of string
Types ¶
type ConcurrentService ¶
type ConcurrentService struct { }
func (*ConcurrentService) GetServiceStruct ¶
func (svc *ConcurrentService) GetServiceStruct() ConcurrentService
func (*ConcurrentService) ProcessConcurrentlySliceInt ¶
func (svc *ConcurrentService) ProcessConcurrentlySliceInt(item []int, occurances int, myFunc func(i int, end int, wg *sync.WaitGroup, item []int, resultChan chan []int, errChan chan error)) ([]int, []error)
ProcessConcurrentlySliceInt process []int data types concurrently with the predefined function
func (*ConcurrentService) ProcessConcurrentlySliceStr ¶
func (svc *ConcurrentService) ProcessConcurrentlySliceStr(item []string, occurances int, myFunc func(i int, end int, wg *sync.WaitGroup, item []string, resultChan chan []string, errChan chan error)) ([]string, []error)
ProcessConcurrentlySliceStr process []string data types
func (*ConcurrentService) ProcessSomething ¶
func (svc *ConcurrentService) ProcessSomething(data interface{}) (interface{}, int, error)
ProcessSomething process the data to be used by the concurrency call.
It can be overridden by initializing new ConcurrentService Struct
type IConcurrent ¶
type IConcurrent interface { ProcessSomething(interface{}) (interface{}, int, error) ProcessConcurrentlySliceInt(item []int, occurances int, myFunc func(i int, end int, wg *sync.WaitGroup, item []int, resultChan chan []int, errChan chan error)) ([]int, []error) ProcessConcurrentlySliceStr(item []string, occurances int, myFunc func(i int, end int, wg *sync.WaitGroup, item []string, resultChan chan []string, errChan chan error)) ([]string, []error) GetServiceStruct() ConcurrentService }
func NewService ¶
func NewService() IConcurrent
Click to show internal directories.
Click to hide internal directories.