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

gopool的RegisterPool使用不了 #153

Open
Java-knight opened this issue Sep 7, 2022 · 1 comment
Open

gopool的RegisterPool使用不了 #153

Java-knight opened this issue Sep 7, 2022 · 1 comment
Labels
question Further information is requested

Comments

@Java-knight
Copy link

Question

大佬您好,我使用了一下gopool.RegisterPool 好像仅仅只是将 这个 Pool 存入了一个sync.Map中,在后续的 gopool.Go 中并没有使用到自己 RegisterPool。是否考虑给 gopool.go文件中init 函数加一个check,如果调用者没有 RegisterPool,在使用 defaultPool。还有就是整个capacity容量是固定的,是否可以加一些动态机制,在大流量的时候taskList中的足够多了,可以进行capacity扩容,当task少的时候capacity可以进行缩容。还望大佬指正观点

@Java-knight Java-knight added the question Further information is requested label Sep 7, 2022
@PureWhiteWu
Copy link
Collaborator

如果想要更改全局的 cap,可以直接用 SetCap 方法来设置,是否能满足你的需求?
关于 capacity 扩缩容的问题,如果这么做的话其实就失去了 gopool 的意义了,gopool 的意义本身就在于要限制 goroutine 数量。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants