Commit graph

94 commits

Author SHA1 Message Date
kerr
e9fb3a020a Make use of scalafix to remove unused import. (#26019)
* =build Add scalafix to remote unused import.

* +build Add file ignore plugin for scalafix which support ignore files.
2018-12-05 08:30:21 +00:00
Christopher Batey
8419671de2 Typed Persistence: onRecoveryFailure callback (#25993) 2018-12-04 10:25:00 +01:00
kerr
68dc288b08 Change ask timeout from Timeout to Duration in typed javadsl. (#25975)
* !typ Change the ActorContext#ask in javadsl to accept a Duration instead of Timeout.

* !typ Change the ActorContext#setReceiveTimeout's parameter name from d to receiveTimeout.
2018-11-30 08:20:37 +00:00
Patrik Nordwall
ea80ce10fa
Merge pull request #25758 from akka/wip-25485-auction-sample-patriknw
AuctionEntity example in Java, #25485
2018-11-09 10:40:14 +01:00
Patrik Nordwall
b1b959df50 AuctionEntity example in Java, #25485 2018-11-09 09:48:26 +01:00
Dale Wijnand
3744baf82f Make OpenAccount#applyEvent match exhaustive (#25890) 2018-11-09 09:05:23 +01:00
Patrik Nordwall
9c1153b1a6 Make the stop message in sharding optional, #25642
* It's mostly technical concern that is blurring the business logic in the entity
* Async interactions before stopping is often not needed
* Implemented with an internal PoisonPill signal that is added by sharding,
* Persistent actors handle PoisonPill and run side effects after persist
  and process stashed messages before stopping.

* remove unecessary stop messages

* reference docs
2018-11-06 19:43:55 +01:00
Patrik Nordwall
3ccc67b3d6
Merge pull request #25812 from akka/wip-25706-thenRun-patriknw
align Effect API between scaladsl and javadsl, #25706
2018-11-06 16:09:39 +01:00
Patrik Nordwall
a948f5572b align Effect API between scaladsl and javadsl, #25706
scaladsl:
* stop => stop()
* andThenStop() => thenStop()

javadsl:
* andThen => thenRun
2018-11-06 15:02:08 +01:00
kerr
fafc59b19d update headers to regular comment (#25807) 2018-10-29 05:19:37 -04:00
Patrik Nordwall
abb3429bc8
Merge pull request #25804 from akka/wip-25750-AbstractBehavior-patriknw
Rename MutableBehavior to AbstractBehavior, #25750
2018-10-18 13:16:48 +02:00
Patrik Nordwall
2672bd7a95 PersistentEntity to glue together Sharding and PersistentBehavior better
* Makes the combination more visable
* You don't have to worry about the persistenceId, only EntityTypeKey and entityId
* The glue is stronger in the javadsl because of two reasons
  * Couldn't realisticly create a PersistentEntity class extending PersistenBehavior (which
    contains all the optional parameters and functions) since that would duplicate too much.
  * The ActorContext would be needed in the ShardedEntityContext parameter and because of the
    additional M type parameters the type inference breaks down when using the factory. Would
    require specifying the type of the ShardedEntityContex[M] parameter. That problem doesn't
    seem to exist in Java.

renamed:
s/ShardedEntityContext/EntityContext/
s/ShardedEntity/Entity/
2018-10-18 11:47:51 +02:00
Patrik Nordwall
bed17cc172
null as empty state, in javadsl, #25768 2018-10-18 11:38:27 +02:00
Patrik Nordwall
1691961a10
AccountExample in Scala in a few flavors, #25485
* AccountExample in Scala in a few flavors
* include Account examples in reference docs
* cleanup BlogPost example
* include reply doc snippets
2018-10-18 11:37:06 +02:00
Patrik Nordwall
81c7adf4a1 thenReply Effect, #25482
* enforce ReplyEffect
2018-10-17 14:02:16 +02:00
Patrik Nordwall
4131036a12
PersistenceId type to differentiate between persistenceId and entityId, #25703 (#25704)
* PersistenceId type to differentiate between persistenceId and entityId, #25703

* both entityId (for sharding) and persistenceId as String types was easy
  mix-up
* utility method in EntityTypeKey to concatenaty the type and entityId to
  a unique persistenceId

* support custom separator to enable compatilbility with Lagom's javadsl
2018-10-17 13:53:50 +02:00
Patrik Nordwall
ad3ad15747 Rename MutableBehavior to AbstractBehavior, #25750
* Also cleanup javadsl Receive, which is only used from AbstractBehavior
* Clarify further in docs that the functional vs OO style is a matter of taste
2018-10-17 08:53:37 +02:00
Patrik Nordwall
d9af08757e rename PersistentBehaviors.receive to PersistentBehavior.apply 2018-10-09 13:47:22 +02:00
Patrik Nordwall
0478d242e1
AccountExample in javadsl, #25485 (#25505) 2018-09-21 15:37:13 +02:00
Patrik Nordwall
6d8d646fe5
Merge pull request #25539 from akka/wip-25480-sharding-start-patriknw
Simplify signature of ClusterSharding.spawn, #25480
2018-09-21 14:21:33 +02:00
Johan Andrén
10fc413238 Some usages of the removed signatures 2018-09-21 10:34:41 +02:00
Johan Andrén
f8d182574a Remove CommandHandler.byState #25655 2018-09-20 16:15:55 +02:00
Johan Andrén
5d129a804b Docs sample of accessing context from persistent behavior 2018-09-20 15:45:16 +02:00
Johan Andrén
68c4e14dbd Command context no longer needed 2018-09-20 15:03:12 +02:00
Johan Andrén
df697175b6 ActorContext removed from more signatures #25620 2018-09-20 14:59:41 +02:00
Johan Andrén
ad1eca9876 Remove the ActorContext parameter from the scaladsl command handler #25620 2018-09-20 13:48:13 +02:00
Patrik Nordwall
0804daf1a5 Simplify signature of ClusterSharding.spawn, #25480 2018-09-20 11:11:33 +02:00
Christopher Batey
1d0603dab9 make scalatest suite type agnostic 2018-09-17 17:54:54 +02:00
Patrik Nordwall
b16e4d5e4d ActorTestKit overhaul, #24598
* composition is the basic building block for ActorTestKit
* ActorTestKitWordSpec for integration with ScalaTest
  (automatic shutdown)

* Use ActorTestKitWordSpec in our own tests

* doc TestException
2018-09-17 17:00:15 +02:00
Johan Andrén
ab63fe037c Add BehaviorInterceptor and a more general way to traverse the behavior stack, #25504
* All nesting behaviors covered with an id parameter
* All wrapping behaviors except supervision replaced with new Intercept implementation
* Implement widen in terms of BehaviorInterceptor
* pass ctx to avoid allocation
2018-09-12 13:03:17 +02:00
Christopher Batey
131e6d10d6 Separate out Effects and ChainedEffects in typed persistence (#25357)
* Separate out Effects and ChainedEffects in typed persistence

* Document order of execution for ChainedEffects
* Change stop to a just a ChainedEffect rather than both

Closes #25042
Closes #25041

* ChainedEffect renamed to SideEffect
2018-08-03 17:15:49 +09:00
Christopher Batey
d8a47b6700
Switch order of javadsl EventHandler type params (#25354)
Closes #25188
2018-07-24 08:47:45 +01:00
Patrik Nordwall
67cc779ca6 Fix recovery timeout in Typed PersistentBehavior, #25268
* The TimerMsg was wrapped in IncomingCommand and therefore stashed,
  and when unstashed causing the ClassCastException
* Solved by not using timers here but plain scheduler
* Also fixing journalPluginId and snapshotPluginId
2018-07-11 10:25:42 +02:00
Christopher Batey
836347fe08 Typed persistence: Throw on persist failures, #24479
* Rather than stop so that users can add their own supervision e.g.
restartWithBackOff
* Only allow back off supervisoir for persistent behaviors
* Handle persist rejections
2018-07-09 10:57:36 +02:00
Patrik Nordwall
9cecba3455 Composable javadsl CommandHandlerBuilder, #25226 (#25227)
* Composable javadsl CommandHandlerBuilder, #25226
* CommandHandlerBuilder with stateClass and statePredicate parameters
* CommandHandlerBuilder.orElse
* Remove ActorContext from handler function signatures, can be
  passed in constructor
2018-07-06 15:35:07 +01:00
Christopher Batey
85754e8a2a Harden PersistentBehaviorSpec (#25301)
As the snapshot is async it might not be ready for the next part of the
test. Use a probe to make sure it is done.

Fixes #25296
2018-07-03 13:58:10 +02:00
Johan Andrén
6e5efccbd6
Fix failure in typed RecoveryPermitterSpec #25233 2018-07-03 12:10:40 +02:00
Patrik Nordwall
a30e039b04 remove andThen overload, #25133 2018-06-14 08:38:38 +02:00
Patrik Nordwall
7f8f3c122b
Merge pull request #25137 from akka/wip-24856-EventHandler-alias-patriknw
add EventHandler type alias, #24856
2018-06-05 10:54:12 +02:00
Viktor Klang (√)
eddc61af82 Documentation updates for Akka Persistence Typed (#25194)
* Switching to throwing exceptions in documentation suggestions
2018-06-05 09:49:01 +01:00
Patrik Nordwall
aceb4d6aa3 add EventHandler type alias, #24856
* for completeness, since we have one for CommandHandler, and sometimes
  it might be useful with the shorter type signature
* use the explicit function type for CommandHandler in API signatures,
  because it's easier to see what it actually is
2018-06-04 15:40:10 +02:00
Richard Imaoka
84d53d1ad1 Persistence: replace initialState with emptyState (#25129) 2018-05-25 14:29:22 +02:00
Christopher Batey
8eb7b1ea81
Typed persistent event adapters/wrappers (#25050)
Typed persistent event adapters/wrappers
2018-05-25 10:23:04 +01:00
Patrik Nordwall
b08d3acb4b Rename Typed TestKit, #25084
Artifact:
akka-testkit-typed -> akka-actor-testkit-typed

Package:
akka.testkit.typed -> akka.actor.testkit.typed

Config:
akka.typed -> akka.actor.typed
akka.testkit.typed -> akka.actor.testkit.typed
2018-05-21 11:51:51 +02:00
Oleksii Tkachuk
8af12295eb Issue 24687: Transfer of PerformanceSpec 2018-05-03 13:30:00 +02:00
Reza Rasouli
89b3820673 Documentation of wrapping PersistentBehavior in typed actor persistence #24679 (#24942)
* Documented wrapping PersistentBehavior in typed actors persistence documentation #24679

* Removed "Current Limitations" section
* Added description on wrapping PersistentBehavior
* Added Scala and Java example for the pattern

* updated persistence docs for the hinted changes

* added  missing "the" as requested in the  hint
2018-05-03 10:20:37 +02:00
Christopher Batey
188b74a013 Remove application.conf from typed test projects (#25015)
It breaks assembly for multi-jvm jobs. Only needs to be in
the tests project.
2018-04-30 10:58:35 +02:00
Christopher Batey
ea23b6ee18 Add classtag to tap/monitor for interception
Interception handles a message that is of the incorrect type as a result
of widening however tap/monitor passed Any as the classtag.
2018-04-23 16:47:56 +01:00
Oleksii Tkachuk
e18382bb0f Optional snapshot store spec #24687 2018-04-11 13:59:55 +02:00
Patrik Nordwall
90541b20db more efficient MDC in Typed persistence, #24787 2018-04-04 14:20:57 +02:00