134 def prune_size: Int = session_options.int("editor_prune_size") |
134 def prune_size: Int = session_options.int("editor_prune_size") |
135 def syslog_limit: Int = session_options.int("editor_syslog_limit") |
135 def syslog_limit: Int = session_options.int("editor_syslog_limit") |
136 def reparse_limit: Int = session_options.int("editor_reparse_limit") |
136 def reparse_limit: Int = session_options.int("editor_reparse_limit") |
137 |
137 |
138 |
138 |
139 /* outlets */ |
139 /* dispatcher */ |
140 |
140 |
141 private val dispatcher = |
141 private val dispatcher = |
142 Consumer_Thread.fork[() => Unit]("Session.dispatcher", daemon = true) { case e => e(); true } |
142 Consumer_Thread.fork[() => Unit]("Session.dispatcher", daemon = true) { case e => e(); true } |
|
143 |
|
144 def assert_dispatcher[A](body: => A): A = |
|
145 { |
|
146 assert(dispatcher.check_thread) |
|
147 body |
|
148 } |
|
149 |
|
150 def require_dispatcher[A](body: => A): A = |
|
151 { |
|
152 require(dispatcher.check_thread) |
|
153 body |
|
154 } |
|
155 |
|
156 def send_dispatcher(body: => Unit): Unit = |
|
157 { |
|
158 if (dispatcher.check_thread) body |
|
159 else dispatcher.send(() => body) |
|
160 } |
|
161 |
|
162 def send_wait_dispatcher(body: => Unit): Unit = |
|
163 { |
|
164 if (dispatcher.check_thread) body |
|
165 else dispatcher.send_wait(() => body) |
|
166 } |
|
167 |
|
168 |
|
169 /* outlets */ |
143 |
170 |
144 val statistics = new Session.Outlet[Session.Statistics](dispatcher) |
171 val statistics = new Session.Outlet[Session.Statistics](dispatcher) |
145 val global_options = new Session.Outlet[Session.Global_Options](dispatcher) |
172 val global_options = new Session.Outlet[Session.Global_Options](dispatcher) |
146 val caret_focus = new Session.Outlet[Session.Caret_Focus.type](dispatcher) |
173 val caret_focus = new Session.Outlet[Session.Caret_Focus.type](dispatcher) |
147 val raw_edits = new Session.Outlet[Session.Raw_Edits](dispatcher) |
174 val raw_edits = new Session.Outlet[Session.Raw_Edits](dispatcher) |