Skip to content

cloudfoundry-samples/multi-process-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multi-Process Sample

This node-js app has two processes, a web and a worker. These are defined in the Procfile.

The web process prints a message based on the path you give it:

curl <multi-process-app>/bananas

Hi, I love bananas!

The worker process calculates the Fibonacci sequence and logs it to stdout.

This repository includes a manifest.yml that will scale the web process to 1 instance and the worker process to 2 instances.

In the logs for the app, you will see messages from both processes interleaved, i.e.:

... [APP/PROC/WORKER/0] OUT Calculating the Fibonacci sequence...
... [APP/PROC/WORKER/0] OUT 1
... [APP/PROC/WEB/0] OUT Server running at http://0.0.0.0:8080/
... [APP/PROC/WORKER/0] OUT 1
... [APP/PROC/WORKER/0] OUT 2
... [APP/PROC/WORKER/0] OUT 3

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published