Toggle navigation
Toggle navigation
This project
Loading...
Sign in
정혜인
/
OSS
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Commits
Issue Boards
Authored by
Dexter Jin
2019-04-17 22:03:20 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
3ba1e9f00d14a718abff214b87c56e47327a77e5
3ba1e9f0
1 parent
614c07bb
Experiments08 Updated
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
5 deletions
Experiments/experiments08/Assignments/01/app.js
Experiments/experiments08/Assignments/01/mymodule.js
Experiments/experiments08/Assignments/02/consumer.js
Experiments/experiments08/Assignments/02/producer.js
Experiments/experiments08/Assignments/01/app.js
View file @
3ba1e9f
// mymodule.js에 정의된 모듈로 불러서 사용하도록 처리
...
...
Experiments/experiments08/Assignments/01/mymodule.js
View file @
3ba1e9f
// 아래 2개의 함수를 모듈로 정의하는 것이 필요함
function
add
(
a
,
b
)
{
return
a
+
b
;
}
...
...
Experiments/experiments08/Assignments/02/consumer.js
View file @
3ba1e9f
...
...
@@ -6,8 +6,3 @@ producer.on('add', function(t) {
});
producer
.
start
();
// stop the clock 10 seconds after
// setTimeout(function() {
// clock.stop();
// }, 10e3)
...
...
Experiments/experiments08/Assignments/02/producer.js
View file @
3ba1e9f
var
inherits
=
require
(
'util'
).
inherits
;
// inherits를 활용하여 Producer construct가 EventEmitter Construct를 상속받도록 해야 함
var
EventEmitter
=
require
(
'events'
).
EventEmitter
;
...
...
@@ -8,4 +9,7 @@ var Producer = function () {
EventEmitter
.
call
(
this
);
}
// producer의 start 함수를 재정의 해야 함
module
.
exports
=
Producer
;
...
...
Please
register
or
login
to post a comment