Skip to content

Upgrade to ZIO 2#48

Open
octavz wants to merge 1 commit into
masterfrom
upgrade_zio_2
Open

Upgrade to ZIO 2#48
octavz wants to merge 1 commit into
masterfrom
upgrade_zio_2

Conversation

@octavz

@octavz octavz commented Jun 25, 2022

Copy link
Copy Markdown
Collaborator

No description provided.

@octavz octavz requested review from LeonDaniel and cipriandrei10 and removed request for LeonDaniel June 25, 2022 06:59
val layer =
Clock.live >+>
Blocking.live >+>
itlayers.kafkaContainer >+>

Copy link
Copy Markdown
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?


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
Copy Markdown
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
Copy Markdown
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

.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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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?

@LeonDaniel LeonDaniel left a comment

Copy link
Copy Markdown
Collaborator

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