unapply pattern for write case statement in select loop
`channel` <~ `x`
transformed to write from channel
into variable x (and evaluating block if write was successful).
unapply pattern for write case statement in select loop
`channel` <~ `x`
transformed to write from channel
into variable x (and evaluating block if write was successful).
unapply pattern for read case statement in select loop
channel ? x
transformed to reading from channel
into variable x (end evaluating block in case statement if read was successful)
Bind 'read' of channel to actor, i.
Bind 'read' of channel to actor, i.e. when message sent to channel, it's passed to actor.
bind write of channel to actor, i.
bind write of channel to actor, i.e. create actor, which will put all received messages into channel.
defer statement: push x to be executed at the end of goScope or go block.
spawn execution of x (wrapped into goScope) in separate execution flow.
spawn execution of x (wrapped into goScope) in separate execution flow.
implementation of go.
implementation of go. public as imlementation details.
go
block of code inside goScope is processed for support of 'defer', 'panic' and 'recover' constructions.
block of code inside goScope is processed for support of 'defer', 'panic' and 'recover' constructions.
Make channel: create go-like channel with given capacity.
Make channel: create go-like channel with given capacity.
throw PanicException
throw PanicException
recover statement: if x (situated inside defer block) will be executed in process of exception handling, inside go scope block, than block will return value of x instead throwing exception.
recover statement: if x (situated inside defer block) will be executed in process of exception handling, inside go scope block, than block will return value of x instead throwing exception.
select pseudoobject -- used for emulation of go 'select' statements via for-comprehancions.
select pseudoobject -- used for emulation of go 'select' statements via for-comprehancions. i.e. next go code:
for(;;) { select case channelA -> x : do-something-with-x case channelB -> y : do-something-with-y }
will looks in scala as
for(s <- select) s match { case `channelA` ~> (x: XType) => do-something-with-x case `channelB` ~> (y: YType) => do-something-with-y }and plain select (without enclosing loop) as for(s <- select.once) s match { case
channelA
~> (x: XType) => do-something-with-x
case channelB
~> (y: YType) => do-something-with-y
}
Access to list of exceptions from defer blocks, which was suppressed during handling of some other 'first' exception.
Access to list of exceptions from defer blocks, which was suppressed during handling of some other 'first' exception.
throw suppresses exception instead first.
throw suppresses exception instead first.
unapply pattern for read case statement in select loop
channel ~> x
transformed to reading from channel
into variable x.
package wich introduce go-like language constructions into scala:
goroutines
go scope support:
channels and select statement support: