Git Product home page Git Product logo

akka-learn's People

Contributors

richardimaoka avatar

Stargazers

 avatar

Watchers

 avatar

akka-learn's Issues

Persistent Actor

As in Eventsourced.scala

  final private[akka] def internalPersist[A](event: A)(handler: A  Unit): Unit = {
    if (recoveryRunning) throw new IllegalStateException("Cannot persist during replay. Events can be persisted when receiving RecoveryCompleted or later.")
    pendingStashingPersistInvocations += 1
    pendingInvocations addLast StashingHandlerInvocation(event, handler.asInstanceOf[Any  Unit])
    eventBatch ::= AtomicWrite(PersistentRepr(event, persistenceId = persistenceId,
      sequenceNr = nextSequenceNr(), writerUuid = writerUuid, sender = sender()))
  }

  final private[akka] def internalPersistAsync[A](event: A)(handler: A  Unit): Unit = {
    if (recoveryRunning) throw new IllegalStateException("Cannot persist during replay. Events can be persisted when receiving RecoveryCompleted or later.")
    pendingInvocations addLast AsyncHandlerInvocation(event, handler.asInstanceOf[Any  Unit])
    eventBatch ::= AtomicWrite(PersistentRepr(event, persistenceId = persistenceId,
      sequenceNr = nextSequenceNr(), writerUuid = writerUuid, sender = sender()))
  }

  final private[akka] def internalDeferAsync[A](event: A)(handler: A  Unit): Unit = {
    if (recoveryRunning) throw new IllegalStateException("Cannot persist during replay. Events can be persisted when receiving RecoveryCompleted or later.")
    if (pendingInvocations.isEmpty) {
      handler(event)
    } else {
      pendingInvocations addLast AsyncHandlerInvocation(event, handler.asInstanceOf[Any  Unit])
      eventBatch = NonPersistentRepr(event, sender()) :: eventBatch
    }
  }

The difference is:

  • persist() vs. persistAsync(): increments pendingStashingInvocations += 1
  • persistAsync() vs. deferAsync(): deferAsync() only executes handler, that's it
    • ( pendingStashingInvocations is irrelevant )

Easy environment setup

download zip -> gist? for each module
git clone -> just run ... better if no cascading (i.e. root directory = each module root) -> gist
gist <-> sub directory sync up?? (.gitignore -> .git in sub dirs?)

Cluster

Break down to multiple issues / articles

For my learning ... as there are several Cluster Github issues I want to contribute

Stream error handling

akka 15710

While processing a stream there are essentially three classes of failure that we should distinguish:

  1. exceptions from user code
  2. exceptions from stream handling infrastructure (a.k.a. bugs)
  3. fatal JVM signals

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.