case class Environment(codecs: Codecs, values: Values) extends Product with Serializable
A collection of codecs and values, which can be populated and then served over RPC.
Example:
val env: Environment = Environment.empty .codec[Int] .codec[List[Int]] .populate { _ .declareStrict[List[Int] => Int]("sum", _.sum) .declare("fac", (n: Int) => Task { (1 to n).product }) } val stopper = env.serve(new InetSocketAddress("localhost",8080)) /// stopper() // shutdown the server
- Alphabetic
- By Inheritance
- Environment
- Serializable
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- def codec[A](implicit T: scala.reflect.api.JavaUniverse.TypeTag[A], C: Codec[A]): Environment
- val codecs: Codecs
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
populate(f: (Values) ⇒ Values): Environment
Modify the values inside this
Environment
, using the given functionf
.Modify the values inside this
Environment
, using the given functionf
. Example:Environment.empty.populate { _.declare("x")(Task.now(42)) }
. -
def
serve(addr: InetSocketAddress, strategy: Strategy = Strategy.DefaultStrategy, numBossThreads: Option[Int] = None, numWorkerThreads: Option[Int] = None, monitoring: Monitoring = Monitoring.empty, capabilities: Capabilities = Capabilities.default, sslParams: Option[SslParameters] = None): Task[Task[Unit]]
start a netty server listening to the given address
start a netty server listening to the given address
- addr
the address to bind to
- strategy
the strategy used for processing incoming requests
- numBossThreads
number of boss threads to create. These are threads which accept incoming connection requests and assign connections to a worker. If unspecified, the default of 2 will be used
- numWorkerThreads
number of worker threads to create. If unspecified the default of 2 * number of cores will be used
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
values(v: Values): Environment
Alias for
this.populate(_ => v)
. - val values: Values
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )