gosharding

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2020 License: MIT Imports: 2 Imported by: 2

README

gosharding

GoDoc

Library to provide a way to process data in parallel by sharding.

License

Licensed under the MIT License

Authors

Copyright(c) 2020 Fred Chien cfsghost@gmail.com

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	PipelineCount  int32
	BufferSize     int
	PrepareHandler func(int32, interface{}, chan interface{})
	Handler        func(int32, interface{})
}

func NewOptions

func NewOptions() *Options

type Pipeline

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

type Shard

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

func NewShard

func NewShard(opts *Options) *Shard

func (*Shard) Push

func (shard *Shard) Push(key uint64, data interface{})

Push will put data to the pipelines by 64 bit key.

func (*Shard) PushKV

func (shard *Shard) PushKV(key string, data interface{})

PushKV will put data to the pipelines by string key

Jump to

Keyboard shortcuts

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