Skip to content

Mateusz00/Task-processing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Task-processing

Prerequisites

  • JDK17

How to use API

Server listens on port 8080 by default

  • Method: POST
    URI: /tasks

Request body:

"base": double (required)
"exponent": double (required)

Response:

"id": long

Description:
Creates and runs task asynchronously, result of the task will be exponentation of "base" and "exponent". Returns unique id of the created task

  • Method: GET
    URI: /task/{id}

Response:

"id": long
"status": string (Possible values: QUEUED, RUNNING, FINISHED, ABORTED)
"progress": int (Values 0-100)
"result": double (Returned only when the task is completed)

Description:
Retrieves information about task with specified id. "result" is returned only when status is set to "FINISHED"

  • Method: GET
    URI: /tasks

Response:

[
  {
    "id": long
    "status": string (Possible values: QUEUED, RUNNING, FINISHED, ABORTED)
    "progress": int (Values 0-100)
    "result": double (Returned only when the task is completed)
  },
  ...
]

Description:
Retrieves information about all tasks. "result" is returned only when status is set to "FINISHED"

How to run

Run these commands in the project directory (JAVA_HOME environment variable needs to be set and pointing to JDK17)

./mvnw clean package
./mvnw spring-boot:run

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages