com.bilalfazlani.zioMaelstrom

Members list

Type members

Classlikes

case class DecodingFailure(error: String, message: GenericMessage)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class DuplicateCallbackAttempt(callbackId: CallbackId)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
enum LogFormat

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
enum NodeInput

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
enum NodeLogLevel(val level: Int)

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class Settings(nodeInput: NodeInput, logLevel: NodeLogLevel, logFormat: LogFormat, concurrency: Int)

Settings for the node

Settings for the node

Value parameters

concurrency

Concurrency level for processing messages. Default is 1024. This means 1024 request messages (receive api) + 1024 response messages (ask api) = 2048 messages can be processed in parallel.

logFormat

You can choose between colored or plain logs. Default is colored

logLevel

You can log messages using logInfo or logError. Output logs can be filtered by setting this value to either Disabled, Info or Error. Default is Info

nodeInput

Input can be taken from stdin or a file. Maelstrom will feed to stdin but when debugging it is easier to use a file. Default is stdin

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class Timeout(messageId: MessageId, remote: NodeId, timeout: Duration)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Types

type Handler[R, I] = (MessageSource, Context) ?=> I => ZIO[MaelstromRuntime & R, Nothing, Unit]
type MaelstromRuntime = Initialisation & MessageSender & Logger & ResponseHandler & Settings

Value members

Concrete methods

def getMyNodeId: ZIO[Initialisation, Nothing, NodeId]
def getOtherNodeIds: ZIO[Initialisation, Nothing, Seq[NodeId]]
def logError(message: => String): URIO[Logger, Unit]
def logInfo(message: => String): URIO[Logger, Unit]
def me(using Context): NodeId
def others(using Context): Seq[NodeId]
def receive[I]: ReceivePartiallyApplied[I]
def src(using MessageSource): NodeId

Extensions

Extensions

extension [A <: NeedsReply](message: A)(message: A)
def reply[B <: Sendable & Reply : JsonEncoder](out: B)(implicit evidence$1: JsonEncoder[B], MessageSource): URIO[MessageSender, Unit]
extension (nodeId: NodeId)(nodeId: NodeId)
def ask[Res <: Reply]: AskPartiallyApplied[Res]
def send[A <: Sendable : JsonEncoder](body: A)(implicit evidence$2: JsonEncoder[A]): URIO[MessageSender, Unit]
extension (p: Path)(p: Path)
infix def /(string: String): Path
extension (s: String)(s: String)
infix def /(string: String): Path