This file contains hidden or 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 OrderId(value: String) | |
case class ItemId(value: String) | |
case class Item(id: ItemId, quantity: Int, unitPrice: Double) | |
sealed trait Order { | |
val id: OrderId | |
val createdAt: Instant | |
val orderStatus: OrderStatus | |
} |
This file contains hidden or 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
// `series` Method Example | |
function eatFreeBread (bread, callback) { | |
setTimeout(function () { | |
console.log('Just ate some ' + bread + ' bread'); | |
callback(null, {breadRating: 8}); | |
}, 3000); | |
} |
This file contains hidden or 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
import scala.concurrent.Future | |
import akka.stream.{ActorMaterializer, KillSwitch, KillSwitches, ThrottleMode} | |
import akka.stream.scaladsl.{Keep, Sink, Source} | |
import akka.actor.ActorSystem | |
import scala.concurrent.duration._ | |
import scala.concurrent.ExecutionContext.Implicits.global | |
import scala.util.Random | |
final case class StockQuote(symbol: String, price: Int) |
This file contains hidden or 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
import scala.concurrent.Future | |
import scala.concurrent.ExecutionContext.Implicits.global | |
import scala.concurrent.Await | |
import scala.concurrent.duration._ | |
import java.util.Calendar | |
case class Movie(name: String, year: Int, rating: BigDecimal, directorId: Int) | |
case class Director(id: Int, name: String, yearBorn: Int) |