Giter VIP home page Giter VIP logo

kekmech-clapi-raspberry's People

Contributors

tonykolomeytsev avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

sgheroman

kekmech-clapi-raspberry's Issues

Get rid of locks in the TaskPool class's main_loop method

There is a blocking code in main_loop method:

def main_loop(self):
    while True:
        self.task_lock.acquire() # <-------------------------------HERE
        # принимаем все входящие сообщения
        self.process_input()
        if len(self.tasks):
            self.process_output()
        else:
            time.sleep(0) # аналог thread.yield() в других языках
        self.task_lock.release() # <--------------------------------- AND HERE

This is because you need to be able to safely add to the list of tasks while running main_loop. I am sure that there is a more elegant solution, I just do not know about it.

The task is get rid of Lock()

Write the tests!

It is necessary to write tests simulating the work of asynchronous requests (Push, Request, LongPoll) to several devices simultaneously. It requires writing mocks.

Кривая работа многопоточности

Запросы, отмеченные как is_infinite=True, магическим образом становятся листенерами сразу на всех устройствах, а не только на том, куда запрос был отправлен. Запрос перестает выполняться через некоторое время, но поток, отправляющий запросы, работу не завершает.

Возможное решение - добавить отдельную логику в виде LongPoll запросов, а из других видов тасков убрать параметр is_infinite.

Add the ability to transfer data via Ethernet

Ethernet is a faster and more reliable way to transfer data between devices than Serial. The STM32 Nucleo has an Ethernet connector and the Raspberry Pi has such a connector. Due to this, in the future it will be possible to complicate the data transfer protocol.

Translate all comments into English.

Rewrite all comments in modules clapi.py and asynclapi.py into English. The reality is that you need to learn English and write documentation in English. So the code of this project will become more informative and understandable for more people.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.