Skip to content

Instantly share code, notes, and snippets.

@alterationx10
alterationx10 / Main.scala
Created June 27, 2023 20:03
ZIO HTTP app using Scope to open/close a resource per websocket connection
import zio.Console.printLine
import zio._
import zio.http.ChannelEvent.UserEvent._
import zio.http.ChannelEvent._
import zio.http._
import java.io.IOException
object Main extends ZIOAppDefault {
@alterationx10
alterationx10 / ZFlag.scala
Last active June 6, 2022 20:57
Just playing around with the concept of Feature Flagging w/ZIO
package com.alterationx10
import com.alterationx10.ZFlag.ZIOFeatureFlag
import zio._
// PSA, just a POC - bad code ahead :-)
// ZIO 2.0.0-RC6 for this...
// Feature flagging service, mainly driven by Ref[Set[String]]...
trait FeatureFlag {
object Gist
// A couple lines to help me remember the 5 ZIO shorthand types.
// Your Milage May Vary 😅
// Offical Links:
// https://zio.dev/docs/overview/overview_index
// https://www.zionomicon.com/
// IO can fail with E, or Succeed with A --- in any environment.
@alterationx10
alterationx10 / build.sbt
Last active November 7, 2016 03:46
Start getting your Play Framework app to work with convox
name := """play_app"""
version := "1.0-SNAPSHOT"
lazy val root = (project in file(".")).enablePlugins(PlayScala)
scalaVersion := "2.11.7"
libraryDependencies ++= Seq(
cache,