Skip to content

Trigger functions in app from PM2 CLI #2509

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Unitech opened this issue Nov 11, 2016 · 2 comments
Closed

Trigger functions in app from PM2 CLI #2509

Unitech opened this issue Nov 11, 2016 · 2 comments

Comments

@Unitech
Copy link
Owner

Unitech commented Nov 11, 2016

We must be able to interact with online processes (eg trigger commands, get results) via PM2 CLI or API:

Expose the ping function from inside your application:

var pmx = require('pmx');

pmx.action('ping', function(reply) {
  // Do stuff
  reply('pong');
});

Then via the PM2 CLI:

$ pm2 trigger <app_name|process_id> <action_name> [optional parameters]

Example:

$ pm2 trigger <app_name|process_id> ping
>>> pm2 trigger index ping
1 processes have received command ping
[index:0]='pong'
Unitech added a commit that referenced this issue Nov 11, 2016
@Unitech Unitech changed the title Trigger functions / Interact with application from PM2 CLI Trigger functions in app from PM2 CLI Nov 11, 2016
@Unitech
Copy link
Owner Author

Unitech commented Nov 21, 2016

Available on development branch:

$ npm install Unitech/pm2#development -g
$ pm2 update

@Unitech
Copy link
Owner Author

Unitech commented Nov 28, 2016

published on [email protected]

@Unitech Unitech closed this as completed Nov 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant