emulator
emulator copied to clipboard
Add "serverless run" core plugin to the Serverless Framework
This plugin should add the run plugin which features the serverless run command.
The plugins should do the following when the serverless run command is executed:
- Check if the local event gateway binary is downloaded on machine
- Check if the version of the local event gateway is up to date
- Re-download local event gateway it it’s not already downloaded / version is out of date
- Check if the local emulator binary is downloaded on machine
- Check if the version of the local emulator is up to date
- Re-download local emulator it it’s not already downloaded / version is out of date
- If local event gateway is not already running → Spawn new forked process and run local event gateway
- Increment count of running local event gateway instances by 1
- If local emulator is not already running → Spawn new forked process and run local emulator
- Increment count of running local emulator instances by 1
- Enter interactive terminal session where the user can enter events as JSON and send the events to the local event gateway by pressing enter
Log information (e.g. that the binary is downloaded, or the binary is starting) should be printed on the users terminal throughout the initialization process.
The following should happen if the user presses ctrl + c to exit the terminal session:
- Decrement count of running local event gateway and local emulator binaries by 1. Kill process of respective binary if it reaches the count 0 after decrementing.