Comments (16)
Keep it simple? Anyone can make another overload and more l2s?
from functionless.
Yeah, I think this is better! We can provide an escape hatch if folk want to pass a pre-existing function
from functionless.
Uhhgg, yeah, good point. Lets enforce the singleton when the automatic name is used?
from functionless.
How should we go about layering this?
- L1
Queue
- no type information, all APIs use the vanilla AWS SDK APIs, e.g.MessageBody: string
- L2
Queue<T>
- captures type information and provides serialization/deserialization utility?
For supporting an arbitrary T
, we will need some Codec<T>
type that encapsulates serialization/deserialization logic.
export interface ReadCodec<Value, Data> {
read(data: Data): Value;
}
export interface WriteCodec<Value, Data> {
write(value: Value): Data;
}
export interface Codec<Value, Data>
extends ReadCodec<Value, Data>,
WriteCodec<Value, Data> {}
export class JsonCodec<T> implements Codec<T, string> {
public read(data: string): T {
return JSON.parse(data);
}
public write(value: T): string {
return JSON.stringify(value);
}
}
from functionless.
Could we do the same contract as secret?
Textqueue and jsonqueue?
Roll parse into the integration?
from functionless.
Could we do the same contract as secret?
Textqueue and jsonqueue?
Roll parse into the integration?
I was thinking the same, although we may need to consider cases like Avro, ProtoBuf, Flatbuffers, etc. So i was wondering if we could have a Codec abstraction - quickly run into limitations with closure serialization and this
though.
from functionless.
That said, JsonSecret likely covers 99% of cases ha
from functionless.
for JsonQueue<T>
, where should we place the parsed value?
interface SQSRecord<T> {
body: string; // <- this is the vanilla AWS API
value: T; // <- maybe we add a new field? Or should we override body?
}
from functionless.
Make it explicit to not polite the sfn state?
from functionless.
Make it explicit to not polite the sfn state?
I don't know what you mean?
from functionless.
Hmm, if this is the interface
public forEach(
handler: Function<SQSEvent<T>, lambda.SQSBatchResponse>,
props?: aws_lambda_event_sources.SqsEventSourceProps
): void {
handler.resource.addEventSource(
new aws_lambda_event_sources.SqsEventSource(this.resource, props)
);
}
And we want to inject code that parses the body string, how would we inject that into the Function?
Should we instead change the interface to be
public forEach(scope: Construct, id: string, props: FunctionProps & SqsEventSourceProps, handle: (event: ..) => ..)
And then have the forEach
instantiate the Function?
from functionless.
Looks good to me, and make the scope optional?
from functionless.
Looks good to me, and make the scope optional?
Yep, even id can default to "forEach"
from functionless.
Looks good to me, and make the scope optional?
Yep, even id can default to "forEach"
Which would work in 99% of cases because it's not like you'd ever attach two consumers
from functionless.
let n = 0;
let name = "forEach";
do {
const child = queue.node.tryFindChild(name);
if(!child) {
break;
}
name = `forEach${++n}`;
} while(true);
from functionless.
let n = 0; let name = "forEach"; do { const child = queue.node.tryFindChild(name); if(!child) { break; } name = `forEach${++n}`; } while(true);
Sure that would work. But it has risks because of you remove one in the middle they all change.
from functionless.
Related Issues (20)
- Feature: escape hatch for Step Function Tasks HOT 2
- Resolve dead links in type docs.
- Support forward-referencing (or late-bound references) from closures
- StepFunctions: support `flatMap`
- Step Functions: String startsWith and contains
- Support explicit `register` hook for functionless HOT 8
- StepFunctions: Promise.all(array.map) should be parallel HOT 2
- Design: Post-Deployment Fragment Executable.
- Step Functions: Retry HOT 2
- Bus: Step Function fails when there are uninitialized members and map/parallel states.
- Bug: `$AWS.SDK` method types return `Date` in step functions HOT 2
- Step Functions: implement `?.` for undefined literals HOT 1
- Bug: Step Functions truthy logic on an object return undefined. HOT 1
- Optimization Feature - Step Functions: Type Hints
- Bug: $SFN.ForEach bound argument uses the wrong source path HOT 2
- Deprecate V1 closure serializer and default to V2 HOT 1
- Step Functions and AppSync : document supported built-in functions and integrations.
- create-functionless-app: Created app cannot synth when using npm
- create-functionless fails with yarn 3
- Is functionless still alive HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from functionless.