-
-
Notifications
You must be signed in to change notification settings - Fork 16
A more complex use case. #3
Comments
Had a quick look at the code, I don't think it supports this right now, but I don't think it'd be too difficult to support it either -- at line 292, |
Right on. I'm just trying to noodle out how I would build out an AWS Lambda application and being able to have one crate hold multiple handlers seems a bit nicer than a workspace full of crates. But I'm just learning Lambda so I wasn't sure. |
You're definitely right, if only because your zip file would be a lot smaller :) Since all the handlers need to be contained in one of the I've been thinking about this as the layout of the macro, sorta similar to lambda! {
"handler" => |(event, context)| Value::String("it's a handler"),
"other_handler" => |(event, context)| Value::String("it's an other handler"),
}; (with the |
Out of pure ignorance, is there a reason that you can't use attributes to make this happen? Rocket uses this approach which I enjoy quite a bit.
|
I'll see if that's possible in stable / Macros 1.1 -- the thing I worry about is that I think all the module exports have to be inside a I'll play around with it when I get a chance and see if we can do something clever. (Implementation suggestions are also welcome.) |
How about just having the first parameter in |
@sunjay Take a look at the macro definition — all of the function names in the module need to be within the (This is assuming you want more than one handler in the same module.) |
@ilianaw Yes that makes sense. Thanks! |
This should be fixed by #9 when it lands. |
Fixed in fcbdffd |
Assuming my project needs more than one endpoint. How does crowbar handle that? Do I use a workspace with N subcrates each building a liblambda? Any guidance on this is much appreciated.
The text was updated successfully, but these errors were encountered: