Skip to content

Commit 8e95fbc

Browse files
committed
Respecting the 80 lines limit in Iso.
1 parent df64538 commit 8e95fbc

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

src/main/scala/scala/reactive/Iso.scala

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,17 @@ import isolate._
6767
* @tparam T the type of the events this isolate produces
6868
*/
6969
trait Iso[@spec(Int, Long, Double) T] extends ReactRecord {
70-
@volatile private[reactive] var frame: IsoFrame = _
71-
@volatile private[reactive] var eventSources: mutable.Set[EventSource] = _
72-
@volatile private[reactive] var systemEmitter: Reactive.Emitter[SysEvent] = _
73-
@volatile private[reactive] var failureEmitter: Reactive.Emitter[Throwable] = _
74-
75-
private def illegal() = throw new IllegalStateException("Only isolate systems can create isolates.")
70+
@volatile private[reactive] var frame:
71+
IsoFrame = _
72+
@volatile private[reactive] var eventSources:
73+
mutable.Set[EventSource] = _
74+
@volatile private[reactive] var systemEmitter:
75+
Reactive.Emitter[SysEvent] = _
76+
@volatile private[reactive] var failureEmitter:
77+
Reactive.Emitter[Throwable] = _
78+
79+
private def illegal() =
80+
throw new IllegalStateException("Only isolate systems can create isolates.")
7681

7782
/* start workaround for a handful of specialization bugs */
7883

@@ -94,7 +99,9 @@ trait Iso[@spec(Int, Long, Double) T] extends ReactRecord {
9499

95100
/** Make sure that system events reach the `systemEmitter`.
96101
*/
97-
react <<= frame.internalConnector.events.collect({ case e: SysEvent => e }).pipe(systemEmitter)
102+
react <<= frame.internalConnector.events.collect({
103+
case e: SysEvent => e
104+
}).pipe(systemEmitter)
98105

99106
/** The unique id of this isolate.
100107
*
@@ -108,7 +115,8 @@ trait Iso[@spec(Int, Long, Double) T] extends ReactRecord {
108115

109116
/** Internal events received by this isolate.
110117
*/
111-
private[reactive] final def internalEvents: Reactive[InternalEvent] = frame.internalConnector.events
118+
private[reactive] final def internalEvents: Reactive[InternalEvent] =
119+
frame.internalConnector.events
112120

113121
/** The system event stream.
114122
*/
@@ -158,7 +166,9 @@ object Iso {
158166
*/
159167
def self[I <: Iso[_]]: I = {
160168
val i = selfIso.get
161-
if (i == null) throw new IllegalStateException(s"${Thread.currentThread.getName} not executing in an isolate.")
169+
if (i == null)
170+
throw new IllegalStateException(
171+
s"${Thread.currentThread.getName} not executing in an isolate.")
162172
i.asInstanceOf[I]
163173
}
164174

0 commit comments

Comments
 (0)