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

What should be the threading model in Tide #50

Closed
bIgBV opened this issue Nov 19, 2018 · 3 comments
Closed

What should be the threading model in Tide #50

bIgBV opened this issue Nov 19, 2018 · 3 comments
Labels
design Open design question

Comments

@bIgBV
Copy link
Contributor

bIgBV commented Nov 19, 2018

Based on the discussion in #48 I'm creating this issue to discuss the general threading model in Tide.

@aturon
Copy link
Collaborator

aturon commented Nov 19, 2018

As @bIgBV points out elsewhere, to some degree we're dependent on hyper here, though its low-level APIs potentially give more flexibility.

A couple questions to consider:

  • Where should endpoint code run? Should we set up a thread pool and spawn endpoint code there always? Make that optional?

  • For the parts of the server that aren't tied directly to endpoints -- i.e., routing, middleware, etc -- do we want to require those pieces to be threadsafe and permit a muli-threaded implementation?

@aturon aturon added the design Open design question label Nov 19, 2018
@bIgBV
Copy link
Contributor Author

bIgBV commented Nov 30, 2018

We should also consider the usecase of handling async tasks. Not in the futures sense, but in a business logic sense. Things like report generation jobs, notification jobs, or some other application specific task performed at a later time.

Plus, another thing to consider is how to handle synchronous tasks as a part of the business logic? Things like database accesses right now are synchronous in nature. The general idea seems to be spawning your own thread pool and running synchronous jobs on them, but can we consider providing built in support for that in Tide?

@yoshuawuyts
Copy link
Member

It's been a while since this issue was opened. Task generation is now handled by the underlying engine; all Tide does is provide the appropriate callback to it.

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

No branches or pull requests

3 participants