Skip to content

[Enhancement] An Improvement Idea for SyncPutQueuePolicy #1584

Open
@qy-liuhuo

Description

@qy-liuhuo

Search before asking

  • I had searched in the issues and found no similar issues.

Enhancement Request

SyncPutQueuePolicy was proposed in #54. When this policy is used and the thread pool blocking queue is full, the main thread will put the rejected task to the queue in a blocking manner.

However, if the system fails to complete the task in the thread pool in time, the put method will be blocked, which will cause the thread to continue to block and the user request to time out.

Describe the solution you'd like

I think it is better to use the offer method of the blocking queue instead of the put method. In this way, we can prevent infinite blocking by setting a timeout

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions