Merge pull request #22200 from akka/wip-21190-promote-PersistenceFSM-patriknw
Promote PersistenceFSM, #21190
This commit is contained in:
commit
554d119446
11 changed files with 8 additions and 42 deletions
|
|
@ -21,13 +21,6 @@ These relations are interpreted as meaning:
|
|||
*If we are in state S and the event E occurs, we should perform the actions A
|
||||
and make a transition to the state S'.*
|
||||
|
||||
.. warning::
|
||||
|
||||
The Java with lambda support part of Akka is marked as **“experimental”** as of its introduction in
|
||||
Akka 2.3.0. We will continue to improve this API based on our users’ feedback, which implies that
|
||||
while we try to keep incompatible changes to a minimum, but the binary compatibility guarantee for
|
||||
maintenance releases does not apply to the :class:`akka.actor.AbstractFSM`, related classes and the
|
||||
:class:`akka.japi.pf` package.
|
||||
|
||||
A Simple Example
|
||||
================
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ tag - for example if the journal stored the events as json it may try to find th
|
|||
|
||||
.. includecode:: code/docs/persistence/PersistenceQueryDocTest.java#events-by-tag
|
||||
|
||||
As you can see, we can use all the usual stream combinators available from `Akka Streams`_ on the resulting query stream,
|
||||
As you can see, we can use all the usual stream combinators available from :ref:`streams-java` on the resulting query stream,
|
||||
including for example taking the first 10 and cancelling the stream. It is worth pointing out that the built-in ``EventsByTag``
|
||||
query has an optionally supported offset parameter (of type ``Long``) which the journals can use to implement resumable-streams.
|
||||
For example a journal may be able to use a WHERE clause to begin the read starting from a specific row, or in a datastore
|
||||
|
|
@ -134,8 +134,8 @@ If your usage does not require a live stream, you can use the ``currentEventsByT
|
|||
|
||||
Materialized values of queries
|
||||
------------------------------
|
||||
Journals are able to provide additional information related to a query by exposing `materialized values`_,
|
||||
which are a feature of `Akka Streams`_ that allows to expose additional values at stream materialization time.
|
||||
Journals are able to provide additional information related to a query by exposing :ref:`materialized-values-quick-java`,
|
||||
which are a feature of :ref:`streams-java` that allows to expose additional values at stream materialization time.
|
||||
|
||||
More advanced query journals may use this technique to expose information about the character of the materialized
|
||||
stream, for example if it's finite or infinite, strictly ordered or not ordered at all. The materialized value type
|
||||
|
|
@ -148,8 +148,6 @@ specialised query object, as demonstrated in the sample below:
|
|||
|
||||
.. includecode:: code/docs/persistence/PersistenceQueryDocTest.java#advanced-journal-query-usage
|
||||
|
||||
.. _materialized values: http://doc.akka.io/docs/akka-stream-and-http-experimental/1.0/java/stream-quickstart.html#Materialized_values
|
||||
.. _Akka Streams: http://doc.akka.io/docs/akka-stream-and-http-experimental/1.0/java.html
|
||||
.. _Community plugins: http://akka.io/community/#plugins-to-akka-persistence-query
|
||||
|
||||
Performance and denormalization
|
||||
|
|
|
|||
|
|
@ -716,13 +716,6 @@ Persistent FSM
|
|||
Its internal state is persisted as a sequence of changes, later referred to as domain events.
|
||||
Relationship between incoming messages, FSM's states and transitions, persistence of domain events is defined by a DSL.
|
||||
|
||||
.. warning::
|
||||
|
||||
``AbstractPersistentFSM`` is marked as **“experimental”** as of its introduction in Akka 2.4.0. We will continue to
|
||||
improve this API based on our users’ feedback, which implies that while we try to keep incompatible
|
||||
changes to a minimum the binary compatibility guarantee for maintenance releases does not apply to the
|
||||
contents of the `classes related to ``AbstractPersistentFSM``.
|
||||
|
||||
A Simple Example
|
||||
----------------
|
||||
To demonstrate the features of the ``AbstractPersistentFSM``, consider an actor which represents a Web store customer.
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ only make sense in streaming and vice versa):
|
|||
Finally in order to :ref:`materialize <stream-materialization-java>` and run the stream computation we need to attach
|
||||
the Flow to a ``Sink<T, M>`` that will get the Flow running. The simplest way to do this is to call
|
||||
``runWith(sink)`` on a ``Source<Out, M>``. For convenience a number of common Sinks are predefined and collected as static methods on
|
||||
the `Sink class <http://doc.akka.io/japi/akka-stream-and-http-experimental/@version@/akka/stream/javadsl/Sink.html>`_.
|
||||
the ``Sink class``.
|
||||
For now let's simply print each author:
|
||||
|
||||
.. includecode:: ../code/docs/stream/TwitterStreamQuickstartDocTest.java#authors-foreachsink-println
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ tag - for example if the journal stored the events as json it may try to find th
|
|||
|
||||
.. includecode:: code/docs/persistence/query/PersistenceQueryDocSpec.scala#events-by-tag
|
||||
|
||||
As you can see, we can use all the usual stream combinators available from `Akka Streams`_ on the resulting query stream,
|
||||
As you can see, we can use all the usual stream combinators available from :ref:`streams-scala` on the resulting query stream,
|
||||
including for example taking the first 10 and cancelling the stream. It is worth pointing out that the built-in ``EventsByTag``
|
||||
query has an optionally supported offset parameter (of type ``Long``) which the journals can use to implement resumable-streams.
|
||||
For example a journal may be able to use a WHERE clause to begin the read starting from a specific row, or in a datastore
|
||||
|
|
@ -130,8 +130,8 @@ If your usage does not require a live stream, you can use the ``currentEventsByT
|
|||
|
||||
Materialized values of queries
|
||||
------------------------------
|
||||
Journals are able to provide additional information related to a query by exposing `materialized values`_,
|
||||
which are a feature of `Akka Streams`_ that allows to expose additional values at stream materialization time.
|
||||
Journals are able to provide additional information related to a query by exposing :ref:`materialized-values-quick-scala`,
|
||||
which are a feature of :ref:`streams-scala` that allows to expose additional values at stream materialization time.
|
||||
|
||||
More advanced query journals may use this technique to expose information about the character of the materialized
|
||||
stream, for example if it's finite or infinite, strictly ordered or not ordered at all. The materialized value type
|
||||
|
|
@ -144,8 +144,6 @@ specialised query object, as demonstrated in the sample below:
|
|||
|
||||
.. includecode:: code/docs/persistence/query/PersistenceQueryDocSpec.scala#advanced-journal-query-usage
|
||||
|
||||
.. _materialized values: http://doc.akka.io/docs/akka-stream-and-http-experimental/1.0/scala/stream-quickstart.html#Materialized_values
|
||||
.. _Akka Streams: http://doc.akka.io/docs/akka-stream-and-http-experimental/1.0/scala.html
|
||||
.. _Community plugins: http://akka.io/community/#plugins-to-akka-persistence-query
|
||||
|
||||
Performance and denormalization
|
||||
|
|
|
|||
|
|
@ -731,13 +731,6 @@ Persistent FSM
|
|||
Its internal state is persisted as a sequence of changes, later referred to as domain events.
|
||||
Relationship between incoming messages, FSM's states and transitions, persistence of domain events is defined by a DSL.
|
||||
|
||||
.. warning::
|
||||
|
||||
``PersistentFSM`` is marked as **“experimental”** as of its introduction in Akka 2.4.0. We will continue to
|
||||
improve this API based on our users’ feedback, which implies that while we try to keep incompatible
|
||||
changes to a minimum the binary compatibility guarantee for maintenance releases does not apply to the
|
||||
contents of the `classes related to ``PersistentFSM``.
|
||||
|
||||
A Simple Example
|
||||
----------------
|
||||
To demonstrate the features of the ``PersistentFSM`` trait, consider an actor which represents a Web store customer.
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ only make sense in streaming and vice versa):
|
|||
Finally in order to :ref:`materialize <stream-materialization-scala>` and run the stream computation we need to attach
|
||||
the Flow to a :class:`Sink` that will get the Flow running. The simplest way to do this is to call
|
||||
``runWith(sink)`` on a ``Source``. For convenience a number of common Sinks are predefined and collected as methods on
|
||||
the :class:`Sink` `companion object <http://doc.akka.io/api/akka-stream-and-http-experimental/@version@/#akka.stream.scaladsl.Sink$>`_.
|
||||
the :class:`Sink` companion object.
|
||||
For now let's simply print each author:
|
||||
|
||||
.. includecode:: ../code/docs/stream/TwitterStreamQuickstartDocSpec.scala#authors-foreachsink-println
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ import java.util.List;
|
|||
* @param <D> the data type
|
||||
* @param <E> the domain event type
|
||||
*
|
||||
* This is an EXPERIMENTAL feature and is subject to change until it has received more real world testing.
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
public class FSMStateFunctionBuilder<S, D, E> {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ import scala.runtime.BoxedUnit;
|
|||
* @param <S> the state type
|
||||
* @param <D> the data type
|
||||
*
|
||||
* This is an EXPERIMENTAL feature and is subject to change until it has received more real world testing.
|
||||
*/
|
||||
public class FSMStopBuilder<S, D> {
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ import scala.reflect.ClassTag
|
|||
* Incoming messages are deferred until the state is applied.
|
||||
* State Data is constructed based on domain events, according to user's implementation of applyEvent function.
|
||||
*
|
||||
* This is an EXPERIMENTAL feature and is subject to change until it has received more real world testing.
|
||||
*/
|
||||
trait PersistentFSM[S <: FSMState, D, E] extends PersistentActor with PersistentFSMBase[S, D, E] with ActorLogging {
|
||||
import akka.persistence.fsm.PersistentFSM._
|
||||
|
|
@ -382,7 +381,6 @@ object PersistentFSM {
|
|||
*
|
||||
* Persistent Finite State Machine actor abstract base class.
|
||||
*
|
||||
* This is an EXPERIMENTAL feature and is subject to change until it has received more real world testing.
|
||||
*/
|
||||
abstract class AbstractPersistentFSM[S <: FSMState, D, E] extends AbstractPersistentFSMBase[S, D, E] with PersistentFSM[S, D, E] {
|
||||
import java.util.function.Consumer
|
||||
|
|
@ -414,7 +412,6 @@ abstract class AbstractPersistentFSM[S <: FSMState, D, E] extends AbstractPersis
|
|||
*
|
||||
* Persistent Finite State Machine actor abstract base class with FSM Logging
|
||||
*
|
||||
* This is an EXPERIMENTAL feature and is subject to change until it has received more real world testing.
|
||||
*/
|
||||
abstract class AbstractPersistentLoggingFSM[S <: FSMState, D, E]
|
||||
extends AbstractPersistentFSMBase[S, D, E]
|
||||
|
|
|
|||
|
|
@ -90,7 +90,6 @@ import scala.concurrent.duration.FiniteDuration
|
|||
* isTimerActive("tock")
|
||||
* </pre>
|
||||
*
|
||||
* This is an EXPERIMENTAL feature and is subject to change until it has received more real world testing.
|
||||
*/
|
||||
trait PersistentFSMBase[S, D, E] extends Actor with Listeners with ActorLogging {
|
||||
|
||||
|
|
@ -548,7 +547,6 @@ trait PersistentFSMBase[S, D, E] extends Actor with Listeners with ActorLogging
|
|||
* Stackable trait for [[akka.actor.FSM]] which adds a rolling event log and
|
||||
* debug logging capabilities (analogous to [[akka.event.LoggingReceive]]).
|
||||
*
|
||||
* This is an EXPERIMENTAL feature and is subject to change until it has received more real world testing.
|
||||
*/
|
||||
trait LoggingPersistentFSM[S, D, E] extends PersistentFSMBase[S, D, E] { this: Actor ⇒
|
||||
|
||||
|
|
@ -617,7 +615,6 @@ trait LoggingPersistentFSM[S, D, E] extends PersistentFSMBase[S, D, E] { this: A
|
|||
/**
|
||||
* Java API: compatible with lambda expressions
|
||||
*
|
||||
* This is an EXPERIMENTAL feature and is subject to change until it has received more real world testing.
|
||||
*/
|
||||
object AbstractPersistentFSMBase {
|
||||
/**
|
||||
|
|
@ -636,7 +633,6 @@ object AbstractPersistentFSMBase {
|
|||
*
|
||||
* Finite State Machine actor abstract base class.
|
||||
*
|
||||
* This is an EXPERIMENTAL feature and is subject to change until it has received more real world testing.
|
||||
*/
|
||||
abstract class AbstractPersistentFSMBase[S, D, E] extends PersistentFSMBase[S, D, E] {
|
||||
import akka.persistence.fsm.japi.pf.FSMStateFunctionBuilder
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue