-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
Hooks #454
Comments
Case 1: Dependency managementNormally a service is not just one single source code file, it may require different modules/packages, we normally call it When a function (to serves as an const a = require('./a')
const b = require('b')
const fx = (ctx) {
a(ctx)
b(ctx)
}
But with before_build: |
npm install b
cp ./a ./a What |
Hooks will help a lot, I am thinking of integrating something like etcd to keep track of services and ports. With AFTER_STARTED, we can just have a simple script which will update the etcd database when a new service comes online or a port is updated. |
@hongkongkiwi sounds like a good idea, would you be nice to explain it more, it'd be helpful if someone likes to add this feature. |
The general idea is AFTER_STARTED will run a curl command which will hit an API endpoint. For example curl http://127.0.0.1/services/update We will need access to some template variables such as: Ideally this should be expressed as JSON automatically by fx when calling the hook. We can pass these something like this e.g. Then our external update point (it could be an fx function even!) will handle updating the router. We can also call directly the etcd api to update. |
Let me clarify it a little bit. Does it look like the following workflow?
it sounds like a workable idea, but that means we need to maintain But I do agree and did consider introducing |
I am thinking to add
hooks
mechanism tofx
,Hooks
Use Case
The text was updated successfully, but these errors were encountered: