Skip to content

Commit

Permalink
added trace
Browse files Browse the repository at this point in the history
  • Loading branch information
Damon Rolfs committed Sep 27, 2014
1 parent e4e9d7e commit aac7efc
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions examples/src/main/scala/blog/post/PostModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,16 @@ object PostModule extends AggregateRootModuleCompanion { module =>

val quiescent: Receive = LoggingReceive {
case GetContent(_) => sender() ! state.content
case AddPost( id, content ) => {
case AddPost( id, content ) => trace.block( s"quiescent(AddPost(${id}, ${content}))" ) {
if ( !content.isIncomplete ) {
persist( PostAdded( id, content ) ) { event =>
state = accept( event )
log info s"New post saved: ${state.content.title}"
publish( event )
trace.block( s"persist(${event})" ) {
trace( s"before accept state = ${state}" )
state = accept( event )
trace( s"after accept state = ${state}" )
log info s"New post saved: ${state.content.title}"
publish( event )
}
}
}
}
Expand Down

0 comments on commit aac7efc

Please sign in to comment.