ActorSystem.dispatcher should be implicit for easier importability
(No description)
Leave a comment
on 2012-05-18 09:39 *
By Patrik Nordwall
I'm curious to know the reason. We already support
So, by defining
Is that all in it, or is there some deeper thought?
implicit val system = ActorSystem()
Future { "a" + "b" }
val system = ActorSystem()
implicit val dispatcher = system.dispatcher
Future { "a" + "b" }
So, by defining
implicit def dispatcher
in ActorSystem we also support val system = ActorSystem()
import system.dispatcher
Future { "a" + "b" }
Is that all in it, or is there some deeper thought?
on 2012-05-18 10:06 *
By Patrik Nordwall
(In revision:2278d1fc8edbf63d2de3307d0469873a40d8629f) ActorSystem.dispatcher should be implicit for easier importability. See #2074
Branch: master
- Makes it more consistent with ActorContext.dispatcher
Branch: master
Thanks for clarification. Fixed.
on 2012-05-18 10:10 *
By Patrik Nordwall
Didn't see your comment about "Why should a system be an execution context?" until now.
I'll create a separate ticket for that if you like. It's another thing.
I tried to understand why the first would work, because an ActorSystem isn't an ExecutionContext. There must be some implicit conversion that I don't see?
I'll create a separate ticket for that if you like. It's another thing.
I tried to understand why the first would work, because an ActorSystem isn't an ExecutionContext. There must be some implicit conversion that I don't see?
on 2012-05-18 12:27 *
By Patrik Nordwall
For the record:
object ExecutionContext {
implicit def defaultExecutionContext(implicit system: ActorSystem): ExecutionContext = system.dispatcher
on 2012-05-21 12:38 *
By Patrik Nordwall
(In revision:2278d1fc8edbf63d2de3307d0469873a40d8629f) ActorSystem.dispatcher should be implicit for easier importability. See #2074
Branch: wip-2006-binary-compat-√
- Makes it more consistent with ActorContext.dispatcher
Branch: wip-2006-binary-compat-√
Updating tickets (#520, #852, #857, #874, #935, #950, #1364, #1508, #1542, #1559, #1734, #1744, #1755, #1782, #1812, #1824, #1831, #1858, #1871, #1880, #1886, #1892, #1896, #1899, #1929, #1930, #1950, #1952, #1953, #1962, #1966, #1969, #1972, #1973, #1977, #1978, #1986, #1988, #1993, #1999, #2000, #2003, #2005, #2006, #2015, #2016, #2019, #2021, #2022, #2023, #2024, #2025, #2029, #2031, #2032, #2036, #2046, #2048, #2051, #2055, #2059, #2061, #2062, #2064, #2065, #2068, #2072, #2074, #2076, #2078, #2079, #2085, #2087, #2088, #2089, #2090, #2091, #2092, #2093, #2095, #2098, #2099, #2100, #2101, #2102, #2119, #2129, #2134, #2135, #2136, #2144, #2147, #2148, #2156, #2166, #2168, #2172, #2174, #2178, #2183)