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

Allow App's listener_executor to be supplied to __init__ #452

Closed
1 of 4 tasks
chrisbouchard opened this issue Aug 28, 2021 · 1 comment · Fixed by #453
Closed
1 of 4 tasks

Allow App's listener_executor to be supplied to __init__ #452

chrisbouchard opened this issue Aug 28, 2021 · 1 comment · Fixed by #453
Labels
Milestone

Comments

@chrisbouchard
Copy link
Contributor

chrisbouchard commented Aug 28, 2021

It would be helpful to be able to supply my own executor to my Bolt app. For my particular use-case, I would like to use an executor from Flask-Executor for an app running in Flask, so that my listener functions automatically run with the current request context.

Additionally, it would allow users to configure the number of threads and the threading strategy (min threads, max threads, etc.).

I would be willing to create a pull request for this feature if it's acceptable. I suspect all that would be required is a new keyword-only parameter to App.__init__. We could fall back to the existing behavior if it's None.

My current work-around is to monkey-patch the executors in ThreadListenerRunner and ThreadLazyListenerRunner. Not difficult, but not future-proof.

Category (place an x in each of the [ ])

  • slack_bolt.App and/or its core components
  • slack_bolt.async_app.AsyncApp and/or its core components
  • Adapters in slack_bolt.adapter
  • Others

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

@seratch
Copy link
Member

seratch commented Aug 28, 2021

Hi @chrisbouchard, thanks for writing in! I agree that enabling developers to custom the part in a safe way is a good addition in future versions.

@seratch seratch added this to the 1.9.0 milestone Aug 28, 2021
chrisbouchard added a commit to chrisbouchard/bolt-python that referenced this issue Aug 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants