Giter Site home page Giter Site logo

CPU 100% with the pool about earl HOT 4 CLOSED

ysbaddaden avatar ysbaddaden commented on May 10, 2024
CPU 100% with the pool

from earl.

Comments (4)

ysbaddaden avatar ysbaddaden commented on May 10, 2024

The culprit is Earl::Logger's agent. It's mailbox becomes full and the channel then blocks whenever an agent tries to log something, which happens with Earl::Pool sending :info log messages.

Injecting Earl::Logger.level = :silent (or :warn) or Earl.application.spawn somewhere will workaround the issue. Note that it's recommended to supervise all your program agents with Earl.application and eventually block the main fiber with Earl.application.start.

from earl.

Nicolab avatar Nicolab commented on May 10, 2024

Ok thanks, Earl.application.spawn solves the issue. I relied on the README that doesn't mention Earl.application.
However, I just saw that it is specified in the source code. I'm going through the code and the specs to better understand Earl's behavior. But I don't see how he solves this problem, by restarting the logger (or mailbox) when it crashes?

I'm in a hurry to use Earl in concrete cases, really fun (à la Elixir processes) and powerful 🚀

from earl.

ysbaddaden avatar ysbaddaden commented on May 10, 2024

Look at the SPEC instead as well as the crystal docs, which you can access with:

$ cd lib/earl
$ crystal docs
$ firefox docs/index.html

Basically Earl.application is an Earl::Supervisor with a few niceties: run & supervise Earl::Logger and any Earl::Agent you tell it to monitor, and also trap a few signals to exit gracefully (to some extent).

from earl.

Nicolab avatar Nicolab commented on May 10, 2024

Ok thanks

from earl.

Related Issues (5)

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.