Skip to content

Instantly share code, notes, and snippets.

View guidoschmidt17's full-sized avatar

Guido Schmidt guidoschmidt17

View GitHub Profile
package cqrs
package domain
package fx
package mastermanagement
import zio.prelude.*
import zio.prelude.fx.*
import eventstore.*
import eventstore.Event.*
testing ZPure
with ZPure : 18.048537958s
result ZPure : 100000000 (Chunk(AggregateCreated(Identified(00000000-0000-0000-0000-000000000000, 0),Identified(00000000-0000-0000-0000-000000000000, 0)),RemovedProperty(Identified(00000000-0000-0000-0000-000000000000, 0),field1),Deleted(Identified(00000000-0000-0000-0000-000000000000, 0))),Right((ItemInstanceImpl(SimpleMaster(7087a789-5ebb-4152-962b-0d62788a29ab,deleted Identified(00000000-0000-0000-0000-000000000000, 0),description),0),())))
testing homegrown Dsl
with homegrown : 16.619121917s
result homegrown : 100000000 Chunk(Created(MasterImpl(90be2364-2e26-4302-ab28-79fb5862861f, 1)),AggregateCreated(Identified(4837d755-bf2b-4a29-823f-cb1222576dc0, 0),MasterImpl(90be2364-2e26-4302-ab28-79fb5862861f, 1)),AggregateCreated(Identified(bf40683b-5eb1-4d38-8f6a-b319ff38590a, 0),MasterImpl(90be2364-2e26-4302-ab28-79fb5862861f, 1)),AggregateCreated(Identified(d2aec4d3-c2f4-463d-b304-048344cf56bb, 0),MasterImpl(90be2364-2e26-4302-ab28-79fb5862861f, 1)),ChangedN
package cqrs
package eventstore
package client
import sttp.capabilities.WebSockets
import sttp.capabilities.zio.ZioStreams
import sttp.client3.*
import sttp.model.Uri
import sttp.ws.*
import zio.*
package cqrs
package eventstore
package server
import cats.effect.std.Console
import fs2.io.net.SocketOption.*
import natchez.Trace.Implicits.noop
import skunk.Session
import zio.*
import zio.interop.catz.*
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8'>
<style>
body {margin: 0; padding: 10px; background-color: #ffffff}
h1 {margin: 5px 0 0 0; font-size: 18px; font-weight: normal; text-align: center}
header {margin: -24px 0 5px 0; line-height: 24px}
button {font: 12px sans-serif; cursor: pointer}
p {margin: 5px 0 5px 0}
def readResultWithOffset[A, B](
check: Option[Query[A, Long]],
query: Query[A ~ Long ~ Long, B],
args: A,
message: String,
chunksize: Int,
limit: Long = Long.MaxValue
) =
val checkResult =
...
handle 18d6aade:11 ReadFactsBySerialId(0,[],500) -> Accepted(TransportEncodedStream)
before
stream 500 500
after
handle 18d6aade:12 ReadFactsBySerialId(0,[],500) -> Accepted(TransportEncodedStream)
before
stream 64 64
stream 128 64
stream 192 64
...
def loopResult(out: Queue[Take[StreamingError, B]], offsetRef: Ref[Long], n: Long) =
def resultStream(offset: Long, limit: Long) =
sessionPool
.use(session => {
session
.prepare(query)
.toScopedZIO
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8'>
<style>
body {margin: 0; padding: 10px; background-color: #ffffff}
h1 {margin: 5px 0 0 0; font-size: 18px; font-weight: normal; text-align: center}
header {margin: -24px 0 5px 0; line-height: 24px}
button {font: 12px sans-serif; cursor: pointer}
p {margin: 5px 0 5px 0}
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8'>
<style>
body {margin: 0; padding: 10px; background-color: #ffffff}
h1 {margin: 5px 0 0 0; font-size: 18px; font-weight: normal; text-align: center}
header {margin: -24px 0 5px 0; line-height: 24px}
button {font: 12px sans-serif; cursor: pointer}
p {margin: 5px 0 5px 0}