|
|
|
|
|
by bastawhiz
1190 days ago
|
|
I don't understand how the example on this page works: https://docs.defer.run/features/delay/ Does the "defer" directory make the exports of those modules special? Because the defer function isn't called until the endpoint is hit, there's no way to really know (without static analysis, which is a can of worms) which functions will actually get deferred. Moreover, how does the defer function know, at runtime, which function on the Defer platform needs to run? I could pass any arbitrary function to defer(), which surely can't be run externally. How does the defer platform know which function it can see (by importing my code) is the function my application has called defer() on? Without knowing exactly the constraints of this, I have a lot of FUD. |
|
When a background function gets a call from your application, the `defer()` wrapper intercepts this call and pushes an execution to the Defer API with the function’s name and serialized arguments.
I hope it makes thinks clearer, let me know!
[update: grammar]