joeldentici / event-store-stream Goto Github PK
View Code? Open in Web Editor NEWTools to interact with Event Store (geteventstore.com)
Tools to interact with Event Store (geteventstore.com)
Right now if a query/effect throws an error it will bring down the Denormalizer or Effector. This might not be the right behavior.
In the case of a Denormalizer, not stopping upon encountering an error could result in an inconsistent read model because we will have missed an event. On the other hand, perhaps the user wants to signal that the event in some way should not be incorporated by throwing an error (rather than the error occurring at a lower level). A possible solution is to introduce a specific error type for this sort of thing, and catch only that type of error, and rethrow anything else. It could be neatly wrapped up in a couple of functions, one for throwing and one for catching. A possible use case for this could be skipping the rest of a computation when a Maybe is Maybe.Nothing.
With Effector, there is also the possibility of weird stuff happening due to inconsistency as well. An email DSL could, for example, store a user's name whenever it changes and read that from its storage whenever sending an email. If the update fails, then future emails might use the wrong name. The effects here probably aren't as devastating as a bad read model, but they can still cause a lot of problems.
I think the best thing to do is probably:
The first two should probably go into monadic-js
and work abstractly with any Monad that supports failing and catching (MonadFail). In fact, the skipping piece should probably just be m.fail(skip)
and the catching piece should be m.catch(continue)
where skip
is a value of the special error type and continue
is a handler that returns m.of()
when the error is the special one and m.fail(err)
when the error is anything else. Retry should just take an appropriate function (MonadFail m => a -> m b
) and a number of attempts to make, and return a new function of the same type that does the same thing with retry-n-times-then-fail semantics.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.