Руководство NodeJS: различия между версиями

Материал из support.qbpro.ru
imported>Supportadmin
Нет описания правки
imported>Supportadmin
Нет описания правки
Строка 1: Строка 1:
===[[Child Process]]===
==[[Child Process]]==
*'''[[Child Process]]'''
'''''Stability: 3 - Stable'''''
'''''Stability: 3 - Stable'''''
:Node обеспечивает трёх-направленный POPEN (3) для модуля child_process.
:Node обеспечивает трёх-направленный POPEN (3) для модуля child_process.
Строка 8: Строка 7:
:Для создания дочернего процесса используйте require('child_process').spawn() или require('child_process').fork(). Семантика каждого немного отличается, и описана ниже.
:Для создания дочернего процесса используйте require('child_process').spawn() или require('child_process').fork(). Семантика каждого немного отличается, и описана ниже.


*[[Process]]
==[[Process]]==
'''''Stability: 2 - Unstable'''''
'''''Stability: 2 - Unstable'''''


Строка 21: Строка 20:
:The third section goes into more depth about how streams work, including some of the internal mechanisms and functions that you should probably not modify unless you definitely know what you are doing.
:The third section goes into more depth about how streams work, including some of the internal mechanisms and functions that you should probably not modify unless you definitely know what you are doing.


*[[Stream]]
==[[Stream]]==
*[[VM]]
==[[VM]]==
*[[Util]]
==[[Util]]==
'''''Stability: 5 - Locked'''''
'''''Stability: 5 - Locked'''''


These functions are in the module 'util'. Use require('util') to access them.
These functions are in the module 'util'. Use require('util') to access them.

Версия от 12:25, 25 августа 2013

Child Process

Stability: 3 - Stable

Node обеспечивает трёх-направленный POPEN (3) для модуля child_process.
Поток данных можно направлять через стандартные stdin, stdout и stderr дочернего процесса в полностью неблокирующем стиле. (Заметим, что некоторые программы используют внутреннюю линейную буферизации строк ввода/вывода. Это не влияет node.js, но это означает что информация, передаваемая дочернему процессу "потребляется" им не сразу.)
Для создания дочернего процесса используйте require('child_process').spawn() или require('child_process').fork(). Семантика каждого немного отличается, и описана ниже.

Process

Stability: 2 - Unstable

A stream is an abstract interface implemented by various objects in Node. For example a request to an HTTP server is a stream, as is stdout. Streams are readable, writable, or both. All streams are instances of EventEmitter
You can load the Stream base classes by doing require('stream'). There are base classes provided for Readable streams, Writable streams, Duplex streams, and Transform streams.
This document is split up into 3 sections. The first explains the parts of the API that you need to be aware of to use streams in your programs. If you never implement a streaming API yourself, you can stop there.
The second section explains the parts of the API that you need to use if you implement your own custom streams yourself. The API is designed to make this easy for you to do.
The third section goes into more depth about how streams work, including some of the internal mechanisms and functions that you should probably not modify unless you definitely know what you are doing.

Stream

VM

Util

Stability: 5 - Locked

These functions are in the module 'util'. Use require('util') to access them.