-
Notifications
You must be signed in to change notification settings - Fork 69
Simplify Binary/Structured Receiver #273
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
Comments
This is why we export https://cloudevents.github.io/sdk-javascript/classes/emitter.html |
What specifically do you have a problem with? |
Really, we should make receiving a CloudEvent easier like is done in python with a simple function: |
If we export the We should probably get rid of them in favor of just |
These classes are essentially the implementation for |
Why do we want both |
That is |
It's frustrating talking about this. There shouldn't be multiple ways of doing things. |
I do not feel this is a productive comment. The SDK should take no opinion on optimization paths. The SDK should leave as many hooks and opening for interesting usecases, which can be more flexible than a function authoring library would like to expose. Frustration based on arbitrary personal opinions should be left at the door, we are all trying to build some helpful generic software to aid in the adoption and usage of CloudEvents. Remember there are more usecases than just yours. It is a tricky balance in this work. |
I'm not trying to optimize, I'm trying to be DRY/KISS as we have duplicative logic in these files:
Where do we say we need to reject encodings in the CESDK requirements? This is not implemented in other SDKs afaik.
I'm happy to adopt to lots of use-cases, really. LMK how this proposal doesn't accommodate. |
Please feel free to contribute code to this project for community review in order to satisfy your demands.
Help me understand where you think the module is “reject[ing] encodings”. This code that you reference does not do such a thing. |
I'm going to go ahead and close this issue, as the one agreed upon step - making |
That's fine. A lot of improvements have been made. There's some internal refactoring for making static receivers (every require('cloudevents') per module shouldn't create 4 objects), but that's not super important right now. |
That's not how it works with |
Updated the comment to "per module". The above sample is requiring in the same npm module. Requiring cloudevents in separate modules creates separate objects/namespaces. |
After this, I'm going to drop it... but... you are mistaken. Please see the Node.js module documentation.
There are some caveats to this. For example, if my project has multiple dependencies which each depend on a different version of |
Describe the Bug
I'd expect the Binary/Structured Receiver to be really easy to setup. A developer shouldn't need to know about what mode the CloudEvent is in when receiving.
These methods should be static too.
Right now there's a lot of complicated logic for the binary/structured HTTP receiver. They should probably be 1 file each.
The text was updated successfully, but these errors were encountered: