1 /* 2 * Make.org Core API 3 * Copyright (C) 2018 Make.org 4 * 5 * This program is free software: you can redistribute it and/or modify 6 * it under the terms of the GNU Affero General Public License as 7 * published by the Free Software Foundation, either version 3 of the 8 * License, or (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU Affero General Public License for more details. 14 * 15 * You should have received a copy of the GNU Affero General Public License 16 * along with this program. If not, see <https://www.gnu.org/licenses/>. 17 * 18 */ 19 20 package org.make.api.technical 21 22 import java.util.concurrent.ExecutorService 23 24 import kamon.instrumentation.executor.ExecutorInstrumentation 25 26 import scala.concurrent.ExecutionContext 27 28 object ExecutorServiceHelper { 29 30 implicit class RichExecutorService(val self: ExecutorService) extends AnyVal { 31 def instrument(name: String): ExecutorService = { 32 ExecutorInstrumentation.instrument(self, name) 33 } 34 35 def toExecutionContext: ExecutionContext = { 36 ExecutionContext.fromExecutorService(self) 37 } 38 } 39 40 }
| Line | Stmt Id | Pos | Tree | Symbol | Tests | Code |
|---|---|---|---|---|---|---|
| 32 | 154 | 1100 - 1146 | Apply | kamon.instrumentation.executor.ExecutorInstrumentation.instrument | org.make.api.technical.crm.crmservicecomponenttest | kamon.instrumentation.executor.ExecutorInstrumentation.instrument(RichExecutorService.this.self, name) |
| 32 | 221 | 1135 - 1139 | Select | org.make.api.technical.ExecutorServiceHelper.RichExecutorService.self | org.make.api.technical.crm.crmservicecomponenttest | RichExecutorService.this.self |
| 36 | 25 | 1246 - 1250 | Select | org.make.api.technical.ExecutorServiceHelper.RichExecutorService.self | org.make.api.technical.crm.crmservicecomponenttest | RichExecutorService.this.self |
| 36 | 242 | 1209 - 1251 | Apply | scala.concurrent.ExecutionContext.fromExecutorService | org.make.api.technical.crm.crmservicecomponenttest | scala.concurrent.ExecutionContext.fromExecutorService(RichExecutorService.this.self) |