Giter VIP home page Giter VIP logo

Comments (3)

octonato avatar octonato commented on May 28, 2024

Hi Francis,

Thanks for the suggestion and feedback.
Have you done some experiments with it? If so, can you push it on fork branch?

from fun-cqrs.

octonato avatar octonato commented on May 28, 2024

One second thought...

The InMemoryBackend works with the IdentityInterpreter which interpret everything to Identity[_].

We could have a AbstractInMemoryBackend[F[_]] and some implementations that that defines the type of F[_].

So, the AbstractInMemoryBackend[F[_]] together with IdentityInterpreter gives you the current InMemortyBackend.

The AbstractInMemoryBackend[F[_]] together with AsyncInterpreter gives you a AsyncInMemortyBackend. That you can use wherever you use a AsyncBackend, for instance the AkkaBackend

from fun-cqrs.

francisdb avatar francisdb commented on May 28, 2024

My use case was testing play controllers with an in memory backend by making my controller have a constructor withbillingBackend: BillingBackend where BillingBackend looks like

trait BillingBackend extends Backend[Future] {
  def accountRef(number: AccountNumber): AggregateRef[Account, Future]
}

But I got stuck when defining the InMemoryBillingBackend because it can't extend the current InMemoryBackend

class InMemoryBillingBackend extends InMemoryBackend with BillingBackend{
// this conflicts because InMemoryBackend is a Backend[Identity] and BillingBackend is a Backend[Future]
}

So I then wanted to wrap the InMemoryBillingBackend but there I again got problems so I gave up and created a ticket 🤔

Your solution sounds like it would allow my use case.

from fun-cqrs.

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.