Learn Wing
Our next step is to create a cloud.Function resource. A function is a cloud resource that executes code in response to some event. We will use our function to push a message into the queue for testing. Below the new cloud.Queue() statement (line 4), write the following code (you can copy & paste, but typing is always more fun): This code should be quite self-explanatory. We define a cloud.Function object and we supply a code block which describes what happens when the function is invoked. This code block is sometimes referred to as a closure. You will notice the inflight modifier before the closure definition. This modifier indicates that this code is executed after the system is deployed. This concept of preflight and inflight is one of the unique concepts of the Wing language. You can read more about it in the Wing documentation Let's invoke our function and see if it's doing what we expect. Locate the cloud.Function node in the simulator and invoke it from the interaction pane by cl
Our next step is to create a cloud.Function resource. A function is a cloud resource that executes code in response to some event. We will use our function to push a message into the queue for testing. Below the new cloud.Queue() statement (line 4), write the following code (you can copy & paste, but typing is always more fun): This code should be quite self-explanatory. We define a cloud.Function object and we supply a code block which describes what happens when the function is invoked. This code block is sometimes referred to as a closure. You will notice the inflight modifier before the cl
Explore this link on the map →