Hello, there is a problem as follows:

Implement a web service in Python (with setting tasks into a queue — to provide for the possibility of multiple parallel requests), returning a list of pixels packed (depending on the iteration number of the departure point) of the set Mandelbrot, for the specified position of the observer (Re and Im on the plane) and the level of increase (array size 500x500). The area and zoom are transmitted using GET parameters (: 8082 /? Position = 0.2,0.3 & zoom = 2). The result before packing must be a triplet tuple (RGB).

Example (request / response):

: 8082 /? Task = create & position = 0.2,0.3 & zoom = 2

{'status': 'working', 'task_id': '43031b39-7e84-44fd-9569-cd7f88f2dd9c'}

: 8082 /? Task = check & task_id = 43031b39-7e84-44fd-9569-cd7f88f2dd9c

{'status': 'working'}

: 8082 /? Task = check & task_id = 43031b39-7e84-44fd-9569-cd7f88f2dd9c

{'status': 'working'}

: 8082 /? Task = check & task_id = 43031b39-7e84-44fd-9569-cd7f88f2dd9c

{'status': 'done'}

: 8082 /? Task = get & task_id = 43031b39-7e84-44fd-9569-cd7f88f2dd9c

[PROTOBUF PACKED DATA]

All that concerns the very Mandelbrot set, I know. The question is, what literature is worth reading to fit everything else in terms of knowledge? Particularly interested in information on web services (I can not figure out how it should be organized and what is needed for this).

Thank you in advance.

    1 answer 1

    download a server like tornado, create default.py, and go !!! And what is this given in the university?

    hello world on tornado

    import tornado.ioloop import tornado.web class MainHandler(tornado.web.RequestHandler): def get(self): self.write("Hello, world") application = tornado.web.Application([ (r"/", MainHandler), ]) if __name__ == "__main__": application.listen(8888) tornado.ioloop.IOLoop.instance().start() 
    • one
      @johniek_comp, no, at the interview) Suppose I download the server, how will it work in python? I would like to read something on this topic. Well, if there are good articles / books about multithreading, gzip and protobuf, then that would be nice. But I found some information on these topics in an understandable format, but so far with working with the server - not really. - R_cassum
    • updated the answer - johniek_comp