Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to ZIO 2 #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Upgrade to ZIO 2 #48

wants to merge 1 commit into from

Conversation

octavz
Copy link
Collaborator

@octavz octavz commented Jun 25, 2022

No description provided.

@octavz octavz requested review from LeonDaniel and cipriansofronia and removed request for LeonDaniel June 25, 2022 06:59
@@ -22,7 +21,6 @@ object KafkaExplorerSpec extends DefaultRunnableSpec:

val layer =
Clock.live >+>
Blocking.live >+>
itlayers.kafkaContainer >+>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we skip over composing layers live this and use the ZLayer.make with automatic injection?

@@ -16,19 +15,19 @@ import org.apache.kafka.clients.consumer.OffsetResetStrategy

object KafkaProducerSpec extends DefaultRunnableSpec:

private val consumerLayer: ZLayer[Has[KafkaContainer], Nothing, Has[KafkaConsumer]] =
Clock.live ++ Blocking.live ++ itlayers.clusterConfig(clusterId = "cluster_id") >>> KafkaConsumer.liveLayer
private val consumerLayer: ZLayer[KafkaContainer, Nothing, KafkaConsumer] =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same comment here: should we try automatic layer creation without operators?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure why would that be necessary, if possible I would use operators to speed up compile time

@@ -31,10 +30,10 @@ object itlayers:
)
.toManaged_

def consumerLayer(cgroup: String): ZLayer[Has[KafkaContainer] with Clock with Blocking, Nothing, Has[Consumer]] =
def consumerLayer(cgroup: String): ZLayer[KafkaContainer with Clock , Nothing, Consumer] =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we write KafkaContainer & Clock instead of KafkaContainer with Clock?


object Logger {

/*
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens with logging? should we delete this object?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logging is not yet ported to zio2


object Config extends Newtype[(String, String)]
type Config = Config.Type
opaque type Config = (String, String)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we build c-tors within companion objects?

Copy link
Collaborator

@LeonDaniel LeonDaniel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see another PR with latest zio updated. Should we bring to speed this PR to have a separate scope or close this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants