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

Wrapper for pure GET without any parameters #72

Open
suntong opened this issue Oct 15, 2023 · 2 comments
Open

Wrapper for pure GET without any parameters #72

suntong opened this issue Oct 15, 2023 · 2 comments

Comments

@suntong
Copy link

suntong commented Oct 15, 2023

How should I write a Handler wrapper for pure GET operation that has no any parameters?

All Handler wrappers seems to need to wrap onto something, of what the user is requesting:

type ScheduleTrainingHandler decorator.CommandHandler[ScheduleTraining]

Then passes on such user requests to the Handler in the end.

However, for a pure GET operation that has no any parameters, like /health that I need to return CPU & Mem info, how should I write a Handler wrapper for it please?

@ronnieholm
Copy link

ronnieholm commented Oct 15, 2023

One could make the argument that implementing a health check endpoint isn't the responsibility of application core. It isn't a business requirement. Health checks belong in the infrastructure layer. It shouldn't go through a command or query.

@suntong
Copy link
Author

suntong commented Oct 15, 2023

Fine. but I do have application core that do not need any parameters at all though. The health check is just an example that I don't need more explanation and people would understand. I do have application core that are like that, no any parameters.

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

2 participants