Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint

Workshop

This workshop contains quiz questions and exercises to help cement your learning in this hour.

Quiz

1. When should you use spawn(), and when should you use fork()?

2. What do you need to watch out for when you use spawn()?

3. When should you use the Cluster module over the Child Process module?

Quiz Answers

1. You should use spawn() when you want to use a system command. Use fork() to create another Node.js process.

2. If you are using a system command when you are developing, you may find that when you deploy your application that the system command is either not available or called something different. If you use spawn(), make sure that Node.js has access to the command when you deploy your application. If you are using Platform as a Service provider, it is likely that system commands will not be available to you.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint