Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the speed is decreasing when using Bubletea with go func to triger out looping main in BubleTea tui Golang #3

Open
t101804 opened this issue Dec 31, 2022 · 0 comments

Comments

@t101804
Copy link

t101804 commented Dec 31, 2022

func (b *Bubble) Init() tea.Cmd {
	go func() {
		pool := itogami.NewPoolWithFunc(uint64(b.Data.Thread), func(i uint32) {
			b.mainScrapInit(b.Data.Weblist[i])
			defer b.wg.Done()
		})

		for i := uint32(0); i < uint32(len(b.Data.Weblist)); i++ {
			b.wg.Add(1)
			pool.Invoke(i)
		}
		b.wg.Wait()
		close(channelMsg)
	}()
	return tea.Batch(doneTick(), func() tea.Msg { return Channel{<-channelMsg, channelMsg} })
}
@t101804 t101804 changed the title not work when using go func to triger in BubleTea tui Golang the speed is decreasing when using go func to triger in BubleTea tui Golang Dec 31, 2022
@t101804 t101804 changed the title the speed is decreasing when using go func to triger in BubleTea tui Golang the speed is decreasing when using Bubletea with go func to triger in BubleTea tui Golang Dec 31, 2022
@t101804 t101804 changed the title the speed is decreasing when using Bubletea with go func to triger in BubleTea tui Golang the speed is decreasing when using Bubletea with go func to triger out looping in BubleTea tui Golang Dec 31, 2022
@t101804 t101804 changed the title the speed is decreasing when using Bubletea with go func to triger out looping in BubleTea tui Golang the speed is decreasing when using Bubletea with go func to triger out looping main in BubleTea tui Golang Dec 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant