Skip to content

support custom lifecycle implementation #39

@Wangyiwei-So

Description

@Wangyiwei-So

https://vscode.dev/github/cilium/hive/blob/main/hive.go#L133-L135

now:

func NewWithOptions(opts Options, cells ...cell.Cell) *Hive {
	h := &Hive{
		lifecycle: &cell.DefaultLifecycle{
			LogThreshold: opts.LogThreshold,
		},
	}
...
}

want:

func NewWithOptions(opts Options, cells ...cell.Cell) *Hive {
	h := &Hive{
		lifecycle: opt.lifecycle
	}
        if h.lifecycle==nil{
               lifecycle=&cell.DefaultLifecycle{
			LogThreshold: opts.LogThreshold,
		},
        }
...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions