peak-ai / ais-service-discovery-js Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v3.0
License: GNU General Public License v3.0
Currently, when finding an instance, we just find the first with the given parameters. This isn't as powerful as it could be. If for example we wanted to do more event-driven programming, we could register different Lambda functions under the same instance name. The instance name could be an event name. In order for this to work, we would need to find every instance with that name, and call each one.
This shouldn't be the default behaviour however, as this could cause problems in a traditional request response method. Therefor, I propose we add a new call type:
await Discovery.event('user-created', user);
This isn't the same as the pub/sub methods, which are intended to interface things like SNS, or NATS for example. In this case, it would find every Lambda, across all services, with the registered name 'user-created', it would then call each one with the given params.
We would need to understand whether or not this is scalable, or whether using something like SNS would still be required or not.
The correct behaviour would be to call each function within the given namespace.
We could also introduce different call modes or algorithms for selecting multiple instances of the name name. Things like 'round robin'.
Is your feature request related to a problem? Please describe.
It looks like this library is providing it's own aws-sdk
dependency, this means if it's being used in conjunction with other AWS services (which it is in our micro services), because of this we are bundling multiple versions of the aws-sdk
into the Lambda, this is going to have an adverse affect on cold starts, deployment times and memory usage.
Describe the solution you would like.
aws-sdk
should be in peerDependencies
(and devDependencies
) and not dependencies
.
Additional context
n/a
Thank you for your contribution!
Running 'npm run build' in examples/infrastructure fails due to missing folder '../lib/infrastructure-stack'
Is there a reason this is missing in the download?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.