Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tiny-worker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sweng-group-15
tiny-worker
Commits
3ee55631
Commit
3ee55631
authored
9 years ago
by
Jason Mulligan
Browse files
Options
Downloads
Patches
Plain Diff
Fleshing it out a little
parent
9447d064
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
lib/index.js
+8
-4
8 additions, 4 deletions
lib/index.js
lib/worker.js
+15
-0
15 additions, 0 deletions
lib/worker.js
src/index.js
+7
-3
7 additions, 3 deletions
src/index.js
src/worker.js
+13
-0
13 additions, 0 deletions
src/worker.js
with
43 additions
and
7 deletions
lib/index.js
+
8
−
4
View file @
3ee55631
//const path = require("path");
"
use strict
"
;
var
path
=
require
(
"
path
"
);
var
worker
=
require
(
path
.
join
(
__dirname
,
"
worker.js
"
));
function
factory
(
arg
)
{
var
fn
=
typeof
arg
===
"
function
"
;
var
fn
=
typeof
arg
===
"
function
"
,
obj
=
undefined
;
obj
=
worker
(
arg
,
fn
);
return
fn
;
return
obj
;
}
module
.
exports
=
factory
;
This diff is collapsed.
Click to expand it.
lib/worker.js
0 → 100644
+
15
−
0
View file @
3ee55631
"
use strict
"
;
var
spawn
=
require
(
"
child_process
"
).
spawn
;
function
factory
(
arg
)
{
var
ps
=
spawn
(
"
grep
"
,
[
arg
]);
ps
.
on
(
"
close
"
,
function
(
code
,
signal
)
{
console
.
log
(
"
child process terminated due to receipt of signal
"
+
signal
);
});
return
ps
;
}
module
.
exports
=
factory
;
This diff is collapsed.
Click to expand it.
src/index.js
+
7
−
3
View file @
3ee55631
//const path = require("path");
const
path
=
require
(
"
path
"
);
const
worker
=
require
(
path
.
join
(
__dirname
,
"
worker.js
"
));
function
factory
(
arg
)
{
let
fn
=
typeof
arg
===
"
function
"
;
let
fn
=
typeof
arg
===
"
function
"
,
obj
;
return
fn
;
obj
=
worker
(
arg
,
fn
);
return
obj
;
}
module
.
exports
=
factory
;
This diff is collapsed.
Click to expand it.
src/worker.js
0 → 100644
+
13
−
0
View file @
3ee55631
const
spawn
=
require
(
"
child_process
"
).
spawn
;
function
factory
(
arg
)
{
let
ps
=
spawn
(
"
grep
"
,
[
arg
]);
ps
.
on
(
"
close
"
,
function
(
code
,
signal
)
{
console
.
log
(
"
child process terminated due to receipt of signal
"
+
signal
);
});
return
ps
;
}
module
.
exports
=
factory
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment