ScalaConverters

gears.async.ScalaConverters

Converters from Gears types to Scala API types and back.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Extensions

Extensions

extension [T](fut: Future[T])
def asGears(using ExecutionContext): Future[T]

Converts a Scala Future into a gears Future. Requires an ExecutionContext, as the job of completing the returned Future will be done through this context. Since Scala Future cannot be cancelled, the returned Future will not clean up the pending job when cancelled.

Converts a Scala Future into a gears Future. Requires an ExecutionContext, as the job of completing the returned Future will be done through this context. Since Scala Future cannot be cancelled, the returned Future will not clean up the pending job when cancelled.

Attributes

extension [T](fut: Future[T])
def asScala: Future[T]

Converts a gears Future into a Scala Scala Future. Note that if fut is cancelled, the returned Scala Future will also be completed with Failure(CancellationException).

Converts a gears Future into a Scala Scala Future. Note that if fut is cancelled, the returned Scala Future will also be completed with Failure(CancellationException).

Attributes