You can send signals and subscribe directly to extremum.studio. This feature, combined with telepresence, allows you to debug serverless functions in an environment close to the real execution environment, interacting with them interactively. Test signals and subscriptions are described in YAML files, which allows them to be stored in the source code management system; The IDE offers verification of the contents of these files to the appropriate data schemas, error highlighting, and auto-completion
Go to signals Administrator extensions and create a signaling point named test do not use a JSON payload scheme for it. Create a file in the workspace with a name ending in .signal.yaml, for example, test.signal.yaml. Add the following lines to it:
kind: regular
exchange: <ID точки обмена test> # test
data:
msg: "test!"
In order not to manually enter the exchange point ID, simply start writing "test" after the name of the "exchange:" property, and the IDE will prompt you to select the exchange point from the list of points containing the word test in the name
To send a signal, click the Send signal link above the signal data.
You can include multiple signals in a single file by separating them with the line "---", which is a standard YAML document separator
kind: regular
exchange: 9e79b1bd-23d7-4b11-82dc-3abd83eced37 # test
data:
msg: "test!"
---
kind: regular
exchange: 35f4a547-c957-45b7-ab84-c35b4301c1f0 # messages
data:
to: all
contents: Hi guys
You can create one or more files with signal subscription lists; such files must have a name ending in * .sub.yaml *. Only one subscription file can be active at a time. The subscription file contains an array of subscription IDs.
Try creating a file in the workspace named test.sub.yaml with the following content (note the hyphen at the beginning of the line - it is important):
- <ID точки обмена test> # test
In order not to manually enter the exchange point ID, simply start writing "test" after the hyphen, and the IDE will prompt you to select the exchange point from the list of points containing the word test in the name
You can include multiple signaling points in a single subscription file. To subscribe, click the Synchronize Subscriptions link above the first line of the list.
In the lower area of the screen, click the * Output * tab and select the * Extremum: Signals * category from the drop-down list in the upper right corner of the tab. In the main area of the window, open the * test.signals.yaml * file and send a signal. The signal will be received by the IDE and displayed in the output area
If your function sends signals, subscribe to them in the IDE. Now, if you you will develop and you will cause function, you can check that the necessary signals are sent, and that the data in them is correct.
If your function is intended to act as a signal handler, develop it, start under control telepresence and assign by the handler for the corresponding exchange point. Set the debugger breakpoint inside the function and send a signal - the debugger should stop the function at the breakpoint, and you can debug it in step-by-step mode