Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
H
HW2 Task manager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
diana.alkateeb
HW2 Task manager
Commits
b076abcb
Commit
b076abcb
authored
Apr 27, 2019
by
Wagner Franchin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/wagnerjfr/task-webserver-docker
parents
184b460d
747ac3e8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
README.md
README.md
+7
-9
No files found.
README.md
View file @
b076abcb
...
...
@@ -17,17 +17,17 @@ P.S. There is another project where I used *ServerSocker* in GitHub: [localhost-
The idea for the tasks comes from another GitHub project
[
TaskScheduler
](
https://github.com/wagnerjfr/Java-TaskScheduler
)
.
The tasks currently implement are:
*
TaskBubbleSort
: sorts a list of numbers.
*
TaskFiboRecursive
: calculates the fibonacci of a number recursively
*
TaskBitcoin
: grabs the last price(s) of the bitcoin from
[
BitStamp
](
https://www.bitstamp.net/
)
.
*
**TaskBubbleSort**
: sorts a list of numbers.
*
**TaskFiboRecursive**
: calculates the fibonacci of a number recursively
*
**TaskBitcoin**
: grabs the last price(s) of the bitcoin from
[
BitStamp
](
https://www.bitstamp.net/
)
.
## How to add tasks
Steps to create a new task
:
The steps to create a new task are
:
*
Create a new class inside the package
`task`
, for example,
`TaskHello.java`
;
*
Make sure your class extends the abstract class
`TaskImpl.java`
;
*
Create a constructor and override the required method
`execute()`
;
*
Add your logic and att
ibute a String
response to the
`response`
instance variable.
*
Add your logic and att
ribute a
`String`
response to the
`response`
instance variable.
Example:
```
...
...
@@ -53,7 +53,7 @@ Result: Hello World; Executed in: 0,00s
```
Just two parameters are allowed:
`-d <task name> -d <parameter values>`
.
If you want to pass more parameter values one suggestion is to use key delimiter like comma
`,`
.
If you want to pass more parameter values
,
one suggestion is to use key delimiter like comma
`,`
.
## Running the web servers in Docker containers
...
...
@@ -67,16 +67,14 @@ cd task-webserver-docker
$ docker build -t taskwebserver:1.0 .
```
### 3. Running the web servers in different containers
Let's two containers. First start the
`WebServerSocket`
container that can be accessed through the port
`8000`
:
Let's
create
two containers. First start the
`WebServerSocket`
container that can be accessed through the port
`8000`
:
```
$ docker run -d --rm --name webserversocket -e WEBSERVER=WebServerSocket -p 8000:8000 taskwebserver:1.0
```
And then start the
`WebServerHttp`
container that can be accessed through the port
`8001`
:
```
$ docker run -d --rm --name webserverhttp -e WEBSERVER=WebServerHttp -p 8001:8000 taskwebserver:1.0
```
Check whether the containers are up and running:
```
$ docker ps -a
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment