Coder Social home page Coder Social logo

pamailbox's People

Contributors

dallaybatta avatar laforge49 avatar skunkiferous avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pamailbox's Issues

Add a second thread-pool to MailboxFactory impl

To eliminate the need to have multiple MailboxFactories, one for each "group of actors" with different "threading needs", in particular used, to limit how many thread each of those groups get to do their work, we have decided to add a second thread-pool to the MailboxFactory, which should be good enough for 99% of the use-cases.

The idea is that we create one thread-pool, where the size is equivalent to the number of processors (Runtime.getRuntime().availableProcessors(), usually +1, to account for the occasional unplanned blocking). This is for the normal, non-blocking, messages,

Then we have a second thread-pool, for the blocking calls. The size of this thread-pool is then user-specified, as it varies a lot between applications.

The big questions are:

  1. How we identify which messages to process in which pool?
  2. What to do with mixed messages, where some would need to be processed in one pools, and some in an other.

I think Bills suggested we control the behavior by fixing the pool choice in the Mailbox itself. This solves both problems, but is a rather "coarse-grained".

We need some kind of CRON-like API

The discussion about timers reminded me of java.util.Timer. I think something like that is essential to an Actor API. Maybe we can extract it from Project Harmony, and turn it into one of our API classes?

Implement systematic failure simulation, to harden the API

To harden the API, as much as is possible, we could add assert statements that call some "test-class", built to throw random exceptions, in a configured way. The idea is that with the assertion disabled, as is expected for production code, this would be totally eliminated at runtime, and cost no resources. But when activated, would cause "random exceptions" to be thrown, in most possible places, allowing us to truly test the exception handling, and check that no request, response or exception gets totally lost. Failure is always possible, but it should be documented, and the goal is that the end-user knows what to expect, with regards to what can go wrong where, and what will happen when it goes wrong.

Use fast 1-to-1 queues to implement "ports"

Following the discovery of the much faster 1-to-1 non-blocking queues, we are now looking how to put those to good use, to improve performance, but without compromising on the current API. Bill suggest we had a new method in Mailbox (not MailboxFactory) that creates a "port" for "direct messaging" from one specific MB to another specific MB. This would allow the actors to have "normal" Mailboxes, but at the same time achieve much faster exchange between specific MB that have a lot of exchanges to do.

How to go about implementing this is not clear yet (at lest not clear to me).

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.