Giter Club home page Giter Club logo

Comments (6)

stefano-maggiolo avatar stefano-maggiolo commented on August 27, 2024

Not discussing the - still ugly - fix of using async_lock to use logger in the second thread, I think it should not be that hard to include a simple asynchronous HTTP(S) client into the current framework of asyncore and AsyncLibrary. I am going to investigate on the problem.

I also wanted to use this thread also to remember that the two actions of assigning a score and to send it to the RWSs are quite different in nature and probably should be split into two different services.

from cms.

lw avatar lw commented on August 27, 2024

Not discussing the - still ugly - fix of using async_lock to use logger in the second thread, I think it should not be that hard to include a simple asynchronous HTTP(S) client into the current framework of asyncore and AsyncLibrary. I am going to investigate on the problem.

I'm against it. Firstly because you used "simple" and "HTTP" in the same sentence, secondly because I don't like giving too much weight to AsyncLibrary (in terms of things that rely on it).

I also wanted to use this thread also to remember that the two actions of assigning a score and to send it to the RWSs are quite different in nature and probably should be split into two different services.

Splitting the services seems a good idea. In this way the new service could use logger again, since there would be no risk of simultaneous access from different threads.

from cms.

stefano-maggiolo avatar stefano-maggiolo commented on August 27, 2024

I'm against it. Firstly because you used "simple" and "HTTP" in the same sentence, secondly because I don't like giving too much weight to AsyncLibrary (in terms of things that rely on it).

Simple because we already have the infrastructure to send things asynchronously on a socket, the only thing that changes is the format of the messages you send on that socket.

Splitting the services seems a good idea. In this way the new service could use logger again, since there would be no risk of simultaneous access from different threads.

If you use a synchronous HTTP library the problem remains: you need one thread per RWS to handle things well, and you can't use the logger anyway with multiple threads.

from cms.

giomasce avatar giomasce commented on August 27, 2024

I can come up with two solutions:

  • One is to pass the message to be logged to the main thread (the one entitled to deal with async), which takes care of sending it to LogServer.
  • The other is to directly instantiate a socket, without going through async, and use it to communicate with LogServer.

Both solutions are quite horrible, but among them I really prefer the first one. Since I hope this problem to be solved at a deeper level, I think we can tolerate it until we have more clear ideas about what to do with async.

Any objections?

from cms.

lw avatar lw commented on August 27, 2024

I'm okay with the first option.

from cms.

stefano-maggiolo avatar stefano-maggiolo commented on August 27, 2024

There is also the async_lock we used in the Worker. Otherwise, option 1 is better of course.

from cms.

Related Issues (20)

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.