Skip to content

peliseev/go_test_task

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Queue in Go with REST interface

Technical Specification (TS)

Implement a queue broker as a web service. The service should handle 2 methods:

  1. PUT /queue?v=message

Put the message "message" into the queue with the name "queue" (the queue name can be any), for example:

In response {empty body + status 200 (ok)}

If the v parameter is missing - empty body + status 400 (bad request)

  1. GET /queue

Take (in a FIFO manner) a message from the queue named "queue" and return it in the body of the http request, for example (the result that should be obtained with the above put's):

When making GET requests, make it possible to set a timeout argument:

If there is no ready message in the queue, the recipient must wait either until the message arrives or until the timeout expires (N - number of seconds). In case the message does not appear - return the code 404. Receivers must receive messages in the same order as the requests were received from them, if 2 receivers are waiting for messages (using timeout), the first message should be received by the one who requested it first.

The port on which the service will listen should be specified in the command line arguments.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages