curl -v -X GET https://oss.sonatype.org/content/repositories/releases/com/github/j5ik2o/reactive-redis-core_2.12/1.0.20/reactive-redis-core_2.12-1.0.20.pom INT(-2) ↵ 3243 22:31:44
Note: Unnecessary use of -X or --request, GET is already inferred.
* Trying 23.22.160.79...
* TCP_NODELAY set
* Connected to oss.sonatype.org (23.22.160.79) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object PersistentWalletAggregate { | |
def behaviorProxy( | |
id: WalletId, | |
chargesLimit: Int = Int.MaxValue | |
): Behavior[CommandRequest] = | |
Behaviors | |
.supervise(Behaviors.setup[CommandRequest] { ctx => | |
val childRef: ActorRef[CommandRequest] = | |
ctx.spawn(WalletAggregate.behavior(id, chargesLimit), WalletAggregate.name(id)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object TestMain extends App { | |
import akka.stream.scaladsl._ | |
import akka.actor._ | |
import akka.stream.ActorMaterializer | |
import scala.concurrent._ | |
import scala.concurrent.duration._ | |
implicit val system = ActorSystem() | |
implicit val ec = system.dispatcher | |
implicit val mat = ActorMaterializer() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package btree | |
package btree | |
type Node interface { | |
Size() int | |
Sum() int64 | |
Min() int64 | |
Max() int64 | |
Find(value int64) *int64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait BTree { | |
fn size(&self) -> i32; | |
fn sum(&self) -> i64; | |
fn min(&self) -> i64; | |
fn max(&self) -> i64; | |
fn find(&self, value: i64) -> Option<i64>; | |
} | |
enum Node { | |
Leaf { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 絵の具を表すオブジェクト(副作用が伴う可変オブジェクト) | |
public class Paint { | |
private int volume; | |
private PigmentColor pigmentColor; | |
// getter, setter 省略 | |
public Paint(PigmentColor pigmentColor, int volume) { | |
this.volume = volume; | |
this.pigmentColor = pigmentColor; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case class Money(amount: BigDecimal, | |
currency: Currency) { | |
def plus(other: Money): Money = { | |
require(currency == other.currency) | |
new Money(amount = amount.add(other.amount), currency) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case class UserAcount(id: Long, name: String, groupId: Long) { | |
// ... | |
def groupName(groupRepository: GroupRepository): Task[GroupName] = groupRepository.resolveBy(groupId).map(_.name) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package domain | |
trait Money { | |
def plus(other: Money): Money | |
def minus(other: Money): Money | |
// ... | |
} |
トレイト: UserAccountRepository[M[_]] https://github.com/j5ik2o/scala-ddd-base/blob/master/example/src/main/scala/com/github/j5ik2o/dddbase/example/repository/UserAccountRepository.scala
実装: UserAccountRepositoryBySkinny https://github.com/j5ik2o/scala-ddd-base/blob/master/example/src/main/scala/com/github/j5ik2o/dddbase/example/repository/skinny/UserAccountRepositoryBySkinny.scala
があったとして、以下のようなDIをさせたいのですが、