AxialAxial
  • Docs
  • Packages
  • GitHub
  • Axial
    • Axial
    • Axial.Process
    • Axial.HttpClient
    • Packages
  • 0.9.1
    • 0.10.0
    • 0.9.3
    • 0.9.2
    • 0.9.1
    • 0.9.0
    • 0.8.0
    • 0.7.1
    • 0.7.0
  • light
  • dark
Axial

Axial.PlatformService

AxialPlatformServiceBaseRuntimeClockEnvironmentVariableEnvironmentVariableErrorsEnvironmentVariablesGuidLogRandomBaseRuntimeBaseRuntimeErrorEnvironmentVariableErrorIClockIEnvironmentVariablesIGuidIHasClockIHasEnvironmentVariablesIHasGuidIHasLogIHasRandomILogIRandom

On This Page

    Axial

    Overview

    • Home
    • API Reference

    Docs

    • Getting Started
      • Getting Started
      • Why Flow?
      • Installation
      • Add Axial to an existing Task application
      • Your First Application
    • How It Compares
      • How It Compares
      • FsToolkit.ErrorHandling Comparison
      • Task vs Flow: seven scenarios
      • Effect-TS Comparison
    • The Flow Type
      • The Flow Type
      • Reading the Type
      • Creating Flows
      • Running Flows
      • The Flow CE
      • Combining Flows
      • Async and Task interop
      • Troubleshooting Types
      • Resources
    • Error Handling
      • Error Handling
      • Bind
      • Policy and verification
      • Defects and Exceptions
    • Dependencies
      • Dependencies
      • The Environment
      • Choosing an Approach
      • Service Contracts
      • Providing the Environment
      • Dependency Tutorials
        • Dependency Tutorials
        • Tutorial: Explicit Dependencies First
        • Tutorial: App Record
    • Platform Services
      • Platform Services
      • Platform Services
        • Platform Services
        • Clock
        • Logging
        • Randomness and GUIDs
        • Environment Variables
      • Console
      • FileSystem
      • Tutorial: Composing Built-in Services
    • Layers
      • Layers
      • Composing Layers
      • Tutorial: Layers
    • Concurrency and State
      • Concurrency and State
      • Fibers
      • Supervision and Fiber Observability
      • Ref (Atomic References)
      • Deferred and Semaphore
      • STM (Software Transactional Memory)
    • Scheduling and Retries
      • Scheduling and Retries
    • Streams
      • Streams
    • Observability
      • Observability
      • Axial.Telemetry
        • Axial.Telemetry
        • JavaScript Telemetry
        • Telemetry Reference
        • JavaScript Reference
    • Platforms and Hosting
      • Platforms and Hosting
      • Application Lifecycle
      • Node Hosting
      • Tutorial: Runtime Operations
      • Browser Hosting
      • Supplying Platform Services
      • .NET Hosting
    • Testing
      • Testing
      • Testing HTTP
      • Runnable Examples
    • Advanced
      • Advanced
      • Providing Services from a Package
      • Scopes and Resources
      • Tutorial: Creating Reusable Services
      • Write an effect-boundary analyzer
    • Notes
      • Notes
      • Packages and platforms
      • Effect-boundary guardrails

    API Reference

    • Axial
      • App
        • Operations
          • start
          • startWithCancellation
          • run
          • runWithCancellation
      • Bind
        • Operations
          • error
          • mapError
      • Builders
        • Operations
          • flow
      • Cause
        • Operations
          • map
          • thenCause
          • both
          • traced
          • failures
          • defects
          • isInterrupted
          • prettyPrint
      • ColdTask
        • Operations
          • create
          • fromTaskFactory
          • awaitStartedTask
          • fromValueTaskFactory
          • fromValueTaskFactoryWithoutCancellation
          • awaitStartedValueTask
          • run
      • Deferred
        • Operations
          • make
          • await
          • complete
          • succeed
          • fail
          • die
          • interrupt
      • Exit
        • Operations
          • map
          • bind
          • mapError
          • mapBoth
          • fromResult
          • toResult
      • Fiber
        • Operations
          • dump
      • FiberDump
        • Operations
          • ofMetadata
          • renderAt
          • renderTreeAt
      • FiberObserver
        • Operations
          • none
          • compose
      • Flow
        • Operations
          • addFinalizerAsync
          • ofExit
          • addFinalizer
          • addDisposable
          • addAsyncDisposable
          • acquireRelease
          • acquireReleaseWith
          • fromAsync
          • fromAsyncResult
          • attemptAsync
          • fromTask
          • fromTaskResult
          • attemptTask
          • fromValueTask
          • fromValueTaskResult
          • attemptValueTask
          • awaitStartedTask
          • awaitStartedTaskResult
          • attemptStartedTask
          • awaitStartedValueTask
          • awaitStartedValueTaskResult
          • attemptStartedValueTask
          • ok
          • succeed
          • value
          • error
          • fail
          • die
          • fromResult
          • verify
          • withFiberObserver
          • addFiberObserver
          • withFiberRegistry
          • withAnnotationSink
          • addAnnotationSink
          • annotate
          • traceId
          • fork
          • forkNamed
          • forkDetached
          • join
          • interrupt
          • zipPar
          • race
          • fromOption
          • fromValueOption
          • orElseFlow
          • env
          • envWith
          • map
          • ignore
          • bind
          • (>>=)
          • tap
          • tapError
          • mapError
          • tracedError
          • mapBoth
          • fold
          • catch
          • orElseWith
          • orElse
          • zip
          • map2
          • apply
          • map3
          • (<!>)
          • (<*>)
          • localEnv
          • delay
          • traverse
          • sequence
          • toAsync
          • startTask
          • run
        • Runtime
          • Operations
            • cancellationToken
            • catchCancellation
            • ensureNotCanceled
            • sleep
            • scope
            • annotations
            • traceId
            • fiberId
            • timeout
            • timeoutToOk
            • timeoutToError
            • timeoutWith
            • retry
            • supervise
      • FlowStream
        • Operations
          • unfoldFlow
          • fromSeq
          • empty
          • singleton
          • fromFlow
          • runForEach
          • map
          • mapError
          • filter
          • choose
          • tapFlow
          • mapFlow
          • take
          • skip
          • takeWhile
          • skipWhile
          • indexed
          • scan
          • distinctUntilChangedBy
          • append
          • collect
          • zip
          • runFold
          • runCollect
          • runDrain
          • runForEachFlow
      • Policy
        • Operations
          • lift
          • withError
          • context
          • pass
          • compose
          • optional
      • RetryPolicy
        • Operations
          • noDelay
      • Schedule
        • Operations
          • recurs
          • spaced
          • exponential
          • jitteredWith
          • retry
          • repeat
      • Semaphore
        • Operations
          • make
          • withPermit
      • SupervisePolicy
        • Operations
          • noDelay
      • State
        • Ref
          • Operations
            • make
            • get
            • set
            • update
            • modify
            • getAndSet
            • getAndUpdate
            • updateAndGet
        • STM
          • Operations
            • retry
            • orElse
            • atomically
        • StmBuilders
          • Operations
            • stm
        • TRef
          • Operations
            • make
            • get
            • set
            • update
        • Ref<'T>
        • STM<'T>
        • StmBuilder
          • Operations
            • ``.ctor``
            • Bind
            • Combine
            • Delay
            • Return
            • ReturnFrom
            • Zero
        • TRef<'T>
      • Telemetry
        • AttributeKey
          • Operations
            • string
            • boolean
            • int64
            • float
            • strings
            • booleans
            • integers
            • floats
        • Context
          • Operations
            • attribute
            • empty
            • ofAttributes
            • add
            • addMany
            • tryFind
            • toSeq
            • endUserId
            • addEndUserId
            • withContext
            • withAttribute
            • withAttributes
            • withEndUserId
            • current
            • withSink
            • addSink
          • Keys
            • Operations
              • endUserId
        • Attribute
          • Representation
            • Key
            • AttributeValue
            • Name
            • Value
        • AttributeKey<'value>
          • Representation
            • Name
            • Encode
            • Decode
        • AttributeValue
          • Union cases
            • IsFloatValues
            • IsBooleanValues
            • IsIntegerValue
            • IsIntegerValues
            • IsStringValue
            • IsStringValues
            • IsFloatValue
            • IsBooleanValue
            • StringValue
            • BooleanValue
            • IntegerValue
            • FloatValue
            • StringValues
            • BooleanValues
            • IntegerValues
            • FloatValues
        • TelemetryContext
      • AppHandle<'error, 'value>
        • Operations
          • Stop
          • Status
          • Completion
      • AppStatus
        • Union cases
          • IsCompleted
          • IsRunning
          • IsStopping
          • Running
          • Stopping
          • Completed
      • BindError<'env, 'error, 'value>
      • Cause<'error>
        • Union cases
          • IsDie
          • IsTraced
          • IsBoth
          • IsInterrupt
          • IsThen
          • IsFail
          • Fail
          • Die
          • Interrupt
          • Then
          • Both
          • Traced
      • ColdTask<'value>
        • Union cases
          • ColdTask
      • Deferred<'error, 'value>
      • EnvFlow<'env, 'value>
      • Exit<'value, 'error>
        • Union cases
          • IsFailure
          • IsSuccess
          • Success
          • Failure
      • ExnEnvFlow<'env, 'value>
      • ExnFlow<'value>
      • Fiber<'error, 'value>
        • Representation
          • Metadata
          • ExitTask
          • InterruptSource
      • FiberDump
        • Representation
          • Id
          • Name
          • ParentId
          • Annotations
          • StartedAt
          • SettledAt
          • Status
      • FiberId
        • Union cases
          • Value
          • FiberId
      • FiberMetadata
        • Representation
          • Id
          • Name
          • ParentId
          • Annotations
          • StartedAt
          • SettledAt
          • Status
          • Observed
      • FiberObserver
        • Representation
          • OnStart
          • OnEnd
          • OnUnobservedDefect
      • FiberRegistry
        • Operations
          • ``.ctor``
          • Dump
          • DumpAt
          • Snapshot
          • Observer
          • LiveFiberCount
      • FiberStatus
        • Union cases
          • IsRunning
          • IsInterrupted
          • IsSucceeded
          • IsFailed
          • Running
          • Succeeded
          • Failed
          • Interrupted
      • Flow<'env, 'error, 'value>
        • Union cases
          • RunSynchronously
          • StartAsTask
          • StartAsValueTask
          • ToAsync
      • Flow<'value>
      • Flow<'error, 'value>
      • FlowBuilder
        • Operations
          • ``.ctor``
          • Bind
          • Combine
          • Delay
          • For
          • Return
          • ReturnFrom
          • Run
          • Source
          • TryFinally
          • TryWith
          • Using
          • While
          • Zero
      • FlowSemaphore
      • FlowStream<'env, 'error, 'value>
        • Union cases
          • FlowStream
      • LogLevel
        • Union cases
          • IsTrace
          • IsDebug
          • IsError
          • IsWarning
          • IsCritical
          • IsInformation
          • Trace
          • Debug
          • Information
          • Warning
          • Error
          • Critical
      • Never
      • Policy<'env, 'error, 'input, 'output>
      • RetryPolicy<'error>
        • Representation
          • MaxAttempts
          • Delay
          • ShouldRetry
      • Schedule<'env, 'input, 'output>
      • Scope
        • Operations
          • ``.ctor``
          • AddAsyncDisposable
          • AddChild
          • AddDisposable
          • AddFinalizer
          • Close
      • ServiceProvider
        • Operations
          • get
      • StreamStep<'value, 'error>
        • Union cases
          • IsNext
          • IsDone
          • Done
          • Next
      • SupervisePolicy
        • Representation
          • MaxAttempts
          • Delay
          • ShouldRestart
    • Axial.Layers
      • Builders
        • Operations
          • layer
      • Layer
        • Operations
          • fromAsync
          • fromValueTask
          • fromTask
          • succeed
          • envWith
          • addFinalizer
          • acquireRelease
          • pool
          • map
          • mapError
          • bind
          • zip
          • zipPar
          • merge
          • map2
          • apply
          • map3
          • provide
      • Layer<'input, 'error, 'output>
      • Pool<'resource>
        • Operations
          • Next
          • Instances
          • Count
    • Axial.PlatformService
      • BaseRuntime
        • Operations
          • liveValue
          • live
          • fromServiceProvider
      • Clock
        • Operations
          • service
          • now
          • utcDateTime
          • unixTimeSeconds
          • unixTimeMilliseconds
          • live
          • fromValue
          • layer
      • EnvironmentVariable
        • Operations
          • get
          • tryGet
          • getInt
          • getInt64
          • getDouble
          • getDecimal
          • getGuid
          • getUri
          • getTimeSpan
          • getBool
      • EnvironmentVariableErrors
        • Operations
          • describe
      • EnvironmentVariables
        • Operations
          • service
          • tryGet
          • getAll
          • set
          • clear
          • expand
          • live
          • fromPairs
          • layer
      • Guid
        • Operations
          • service
          • newGuid
          • live
          • fromValue
          • layer
      • Log
        • Operations
          • service
          • log
          • trace
          • debug
          • info
          • warning
          • error
          • critical
          • logException
          • errorExn
          • criticalExn
          • live
          • fromSink
          • layer
      • Random
        • Operations
          • service
          • next
          • nextMax
          • nextInt
          • nextDouble
          • nextBytes
          • bytes
          • live
          • fromValue
          • fromFixed
          • layer
      • BaseRuntime
        • Representation
          • Clock
          • Log
          • Random
          • Guid
          • EnvironmentVariables
      • BaseRuntimeError
        • Union cases
          • MissingService
      • EnvironmentVariableError
        • Union cases
          • IsInvalidVariable
          • IsMissingVariable
          • MissingVariable
          • InvalidVariable
      • IClock
        • Operations
          • UtcNow
      • IEnvironmentVariables
        • Operations
          • Expand
          • GetAll
          • Set
          • TryGet
      • IGuid
        • Operations
          • NewGuid
      • IHasClock
        • Operations
          • Clock
      • IHasEnvironmentVariables
        • Operations
          • EnvironmentVariables
      • IHasGuid
        • Operations
          • Guid
      • IHasLog
        • Operations
          • Log
      • IHasRandom
        • Operations
          • Random
      • ILog
        • Operations
          • Log
          • LogException
      • IRandom
        • Operations
          • Next
          • NextBytes
          • NextDouble
          • NextInt
          • NextMax
    • Axial.Console
      • Console
        • Operations
          • service
          • input
          • output
          • error
          • inputEncoding
          • setInputEncoding
          • outputEncoding
          • setOutputEncoding
          • isInputRedirected
          • isOutputRedirected
          • isErrorRedirected
          • keyAvailable
          • read
          • readLine
          • readKey
          • write
          • writeLine
          • writeError
          • writeErrorLine
          • openStandardInput
          • openStandardOutput
          • openStandardError
          • clear
          • beep
          • resetColor
          • foregroundColor
          • setForegroundColor
          • backgroundColor
          • setBackgroundColor
          • cursorPosition
          • setCursorPosition
          • cursorVisible
          • setCursorVisible
          • title
          • setTitle
          • treatControlCAsInput
          • setTreatControlCAsInput
          • live
      • IConsole
        • Operations
          • Beep
          • Clear
          • OpenStandardError
          • OpenStandardInput
          • OpenStandardOutput
          • Read
          • ReadKey
          • ReadLine
          • ResetColor
          • SetCursorPosition
          • Write
          • WriteError
          • WriteErrorLine
          • WriteLine
          • Title
          • Out
          • BackgroundColor
          • CursorTop
          • InputEncoding
          • OutputEncoding
          • Error
          • ForegroundColor
          • IsInputRedirected
          • IsErrorRedirected
          • IsOutputRedirected
          • KeyAvailable
          • CursorVisible
          • CursorLeft
          • In
          • TreatControlCAsInput
      • IHasConsole
        • Operations
          • Console
    • Axial.FileSystem
      • FileSystem
        • Operations
          • service
          • readAllText
          • readAllTextWithEncoding
          • readAllTextAsync
          • readAllLines
          • readAllLinesWithEncoding
          • readAllLinesAsync
          • readAllBytes
          • readAllBytesAsync
          • writeAllText
          • writeAllTextWithEncoding
          • writeAllTextAsync
          • writeAllLines
          • writeAllLinesWithEncoding
          • writeAllLinesAsync
          • writeAllBytes
          • writeAllBytesAsync
          • appendAllText
          • appendAllTextWithEncoding
          • appendAllTextAsync
          • appendAllLines
          • appendAllLinesWithEncoding
          • fileExists
          • exists
          • deleteFile
          • copyFile
          • moveFile
          • createFileSymbolicLink
          • createDirectorySymbolicLink
          • getSymbolicLinkTarget
          • resolveSymbolicLinkTarget
          • openFile
          • openFileWithAccess
          • openFileWithShare
          • openRead
          • openText
          • openWrite
          • createFile
          • createText
          • appendText
          • getFileAttributes
          • setFileAttributes
          • getFileCreationTime
          • getFileCreationTimeUtc
          • setFileCreationTime
          • setFileCreationTimeUtc
          • getFileLastAccessTime
          • getFileLastAccessTimeUtc
          • setFileLastAccessTime
          • setFileLastAccessTimeUtc
          • getFileLastWriteTime
          • getFileLastWriteTimeUtc
          • setFileLastWriteTime
          • setFileLastWriteTimeUtc
          • directoryExists
          • createDirectory
          • deleteDirectory
          • moveDirectory
          • enumerateFiles
          • getFiles
          • enumerateDirectories
          • getDirectories
          • enumerateFileSystemEntries
          • getFileSystemEntries
          • getLogicalDrives
          • getDirectoryRoot
          • getParent
          • getCurrentDirectory
          • setCurrentDirectory
          • getDirectoryCreationTime
          • getDirectoryCreationTimeUtc
          • setDirectoryCreationTime
          • setDirectoryCreationTimeUtc
          • getDirectoryLastAccessTime
          • getDirectoryLastAccessTimeUtc
          • setDirectoryLastAccessTime
          • setDirectoryLastAccessTimeUtc
          • getDirectoryLastWriteTime
          • getDirectoryLastWriteTimeUtc
          • setDirectoryLastWriteTime
          • setDirectoryLastWriteTimeUtc
          • combine
          • changeExtension
          • getDirectoryName
          • getInvalidFileNameChars
          • getInvalidPathChars
          • getExtension
          • getFileName
          • getFileNameWithoutExtension
          • getFullPath
          • getPathRoot
          • getRelativePath
          • getTempPath
          • getTempFileName
          • getRandomFileName
          • hasExtension
          • endsInDirectorySeparator
          • trimEndingDirectorySeparator
          • isPathFullyQualified
          • isPathRooted
          • live
      • FileSystemError
        • Operations
          • fromException
          • describe
      • FileSystemError
        • Union cases
          • IsInvalidPath
          • IsUnauthorized
          • IsFileNotFound
          • IsUnsupported
          • IsDirectoryNotFound
          • IsIo
          • IsCanceled
          • IsPathTooLong
          • IsAlreadyExists
          • IsUnexpected
          • FileNotFound
          • DirectoryNotFound
          • AlreadyExists
          • Unauthorized
          • InvalidPath
          • PathTooLong
          • Canceled
          • Io
          • Unsupported
          • Unexpected
      • IFileSystem
        • Operations
          • AppendAllLines
          • AppendAllLines
          • AppendAllText
          • AppendAllText
          • AppendAllTextAsync
          • AppendText
          • ChangeExtension
          • Combine
          • CopyFile
          • CreateDirectory
          • CreateDirectorySymbolicLink
          • CreateFile
          • CreateFileSymbolicLink
          • CreateText
          • DeleteDirectory
          • DeleteFile
          • DirectoryExists
          • EndsInDirectorySeparator
          • EnumerateDirectories
          • EnumerateFileSystemEntries
          • EnumerateFiles
          • FileExists
          • GetCurrentDirectory
          • GetDirectories
          • GetDirectoryCreationTime
          • GetDirectoryCreationTimeUtc
          • GetDirectoryLastAccessTime
          • GetDirectoryLastAccessTimeUtc
          • GetDirectoryLastWriteTime
          • GetDirectoryLastWriteTimeUtc
          • GetDirectoryName
          • GetDirectoryRoot
          • GetExtension
          • GetFileAttributes
          • GetFileCreationTime
          • GetFileCreationTimeUtc
          • GetFileLastAccessTime
          • GetFileLastAccessTimeUtc
          • GetFileLastWriteTime
          • GetFileLastWriteTimeUtc
          • GetFileName
          • GetFileNameWithoutExtension
          • GetFileSystemEntries
          • GetFiles
          • GetFullPath
          • GetInvalidFileNameChars
          • GetInvalidPathChars
          • GetLogicalDrives
          • GetParent
          • GetPathRoot
          • GetRandomFileName
          • GetRelativePath
          • GetSymbolicLinkTarget
          • GetTempFileName
          • GetTempPath
          • HasExtension
          • IsPathFullyQualified
          • IsPathRooted
          • MoveDirectory
          • MoveFile
          • OpenFile
          • OpenFile
          • OpenFile
          • OpenRead
          • OpenText
          • OpenWrite
          • ReadAllBytes
          • ReadAllBytesAsync
          • ReadAllLines
          • ReadAllLines
          • ReadAllLinesAsync
          • ReadAllText
          • ReadAllText
          • ReadAllTextAsync
          • ResolveSymbolicLinkTarget
          • SetCurrentDirectory
          • SetDirectoryCreationTime
          • SetDirectoryCreationTimeUtc
          • SetDirectoryLastAccessTime
          • SetDirectoryLastAccessTimeUtc
          • SetDirectoryLastWriteTime
          • SetDirectoryLastWriteTimeUtc
          • SetFileAttributes
          • SetFileCreationTime
          • SetFileCreationTimeUtc
          • SetFileLastAccessTime
          • SetFileLastAccessTimeUtc
          • SetFileLastWriteTime
          • SetFileLastWriteTimeUtc
          • TrimEndingDirectorySeparator
          • WriteAllBytes
          • WriteAllBytesAsync
          • WriteAllLines
          • WriteAllLines
          • WriteAllLinesAsync
          • WriteAllText
          • WriteAllText
          • WriteAllTextAsync
      • IHasFileSystem
        • Operations
          • FileSystem
    • Axial.Hosting
      • DotNetApp
        • Operations
          • exitCode
          • run
      • FiberLogging
        • Operations
          • observer
          • observe
      • Hosting
        • Operations
          • addApp
          • addAppWith
      • MicrosoftLogging
        • Operations
          • create
          • fromFactory
          • layer
      • FlowHostedService<'env, 'error>
        • Operations
          • ``.ctor``
      • HostedAppOptions
        • Representation
          • Default
          • StopHostOnCompletion
    • Axial.Hosting.Node
      • NodeApp
        • Operations
          • arguments
          • exitCode
          • start
          • run
      • NodeEnvironment
        • Operations
          • live
    • Axial.Hosting.Browser
      • BrowserApp
        • Operations
          • mount
          • startWithSignal
      • AbortSignal
    • Axial.Telemetry
      • Activity
        • Operations
          • runtimeSource
          • traceWithSource
          • traceOn
          • withTracer
          • traceWith
          • trace
      • ActivityTracer
        • Operations
          • create
      • FiberDumpTelemetry
        • Operations
          • record
      • FiberMetrics
        • Operations
          • meter
          • observer
          • observe
      • FiberTelemetry
        • Operations
          • observer
          • observe
          • observerWithSpans
          • observeWithSpans
      • ActivityTracer
        • Operations
          • Trace
          • TraceWith
          • Source
    • Axial.Telemetry.JavaScript
      • FiberTelemetry
        • Operations
          • observer
          • observe
          • observerWithSpans
          • observeWithSpans
      • Otel
        • Operations
          • installNamed
          • install
          • installWith
          • uninstall
          • traceWith
          • trace
      • ContextApi
        • Operations
          • active
          • ``with``
      • OpenTelemetryApi
        • Operations
          • trace
          • context
      • OtelContext
      • Span
        • Operations
          • ``end``
          • setAttribute
          • setStatus
          • spanContext
      • TraceApi
        • Operations
          • getTracer
          • setSpan
      • Tracer
        • Operations
          • startSpan