broker

package module
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: MIT Imports: 0 Imported by: 0

README ¶

broker

the broker of component

💡 Usage

You can import broker using:

import (
"context"

"github.com/phuhao00/broker"
mongobrocker "github.com/phuhao00/broker/mongo"
)

Then use one of the helpers below:

Client



 var Client *mongobrocker.Client

func init() {
    ctx := context.Background()
    tc := &mongobrocker.Client{
    BaseComponent: broker.NewBaseComponent(),
    RealCli: mongobrocker.NewClient(ctx, &mongobrocker.Config{
    URI:         "mongodb://localhost:27017",
    MinPoolSize: 3,
    MaxPoolSize: 3000,
    }),
 }
}


Documentation ¶

Index ¶

Constants ¶

This section is empty.

Variables ¶

This section is empty.

Functions ¶

This section is empty.

Types ¶

type BaseComponent ¶

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

func NewBaseComponent ¶

func NewBaseComponent() *BaseComponent

func (*BaseComponent) Launch ¶

func (b *BaseComponent) Launch()

func (*BaseComponent) Resolve ¶

func (b *BaseComponent) Resolve(op Operation)

func (*BaseComponent) Stop ¶

func (b *BaseComponent) Stop()

type CallBackFn ¶

type CallBackFn func()

type Component ¶

type Component interface {
	Resolve(opCh Operation)
	Launch()
	Stop()
}

type Operation ¶

type Operation struct {
	IsAsynchronous bool
	CB             CallBackFn
	Ret            chan interface{}
}

Directories ¶

Path Synopsis
nsq

Jump to

Keyboard shortcuts

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