forked from Unitech/pm2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
92 changed files
with
2,878 additions
and
787 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,10 @@ | ||
<!-- | ||
Your issue may already be reported! | ||
Please search on the [issue tracker](https://github.com/Unitech/pm2/search?type=Issues) before creating one. | ||
--> | ||
|
||
## What's going wrong? | ||
|
||
## How could we reproduce this issue? | ||
|
||
## Supporting information | ||
|
||
<!-- | ||
Please run the following command (available on PM2 >= 2.6) | ||
--> | ||
``` | ||
# Run the following commands | ||
$ pm2 report | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs | ||
|
||
name: Node.js CI | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
|
||
strategy: | ||
matrix: | ||
node-version: [20.x, 18.x] | ||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: oven-sh/setup-bun@v1 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
- run: sudo apt install python3 | ||
- run: sudo apt install php-cli | ||
- run: npm install | ||
- run: npm run test:e2e | ||
- run: npm run test:unit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,6 @@ test/child | |
dist/ | ||
*.deb | ||
*.rpm | ||
package-lock.json | ||
.DS_Store | ||
*.swp | ||
*.swo | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
process.on('message', function(packet) { | ||
process.send({ | ||
type : 'process:msg', | ||
data : { | ||
success : true | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
const pm2 = require('../..') | ||
|
||
console.log(pm2) | ||
|
||
pm2.connect(function() { | ||
pm2.sendDataToProcessId({ | ||
// id of procces from "pm2 list" command or from pm2.list(errback) method | ||
id : '1', | ||
|
||
// process:msg will be send as 'message' on target process | ||
type : 'process:msg', | ||
|
||
// Data to be sent | ||
data : { | ||
some : 'data' | ||
}, | ||
|
||
topic: true | ||
}, function(err, res) { | ||
}) | ||
}) | ||
|
||
// Listen to messages from application | ||
pm2.launchBus(function(err, pm2_bus) { | ||
pm2_bus.on('process:msg', function(packet) { | ||
console.log(packet) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
var tx2 = require('tx2') | ||
var http = require('http') | ||
|
||
var meter = tx2.meter({ | ||
name : 'req/sec', | ||
samples : 1, | ||
timeframe : 60 | ||
}) | ||
|
||
http.createServer(function (req, res) { | ||
meter.mark() | ||
res.writeHead(200, {'Content-Type': 'text/plain'}) | ||
res.write('Hello World!') | ||
res.end() | ||
}).listen(6001) |
Oops, something went wrong.