aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/scala/async/Async.scala
Commit message (Collapse)AuthorAgeFilesLines
* Enable generalized state machinestopic/wip-futuresystem-extensionPhilipp Haller2013-05-231-7/+5
| | | | | | | - async { } block can now generate a subclass of an existing trait - future system can directly return the state machine instance from async, without spawning an actual future - adds iterator-based async implementation with future system
* Abstract over type of generated state machinePhilipp Haller2013-04-261-3/+3
| | | | Removes method `TransformUtils.applied`.
* Abstract from Try in onComplete of FutureSystem#OpsPhilipp Haller2013-04-261-3/+3
| | | | | Adds `Result[A]` type member to `FutureSystem` and `def resultType[A]` to `FutureSystem#Ops`.
* Mark `await` as @compileTimeOnlyJason Zaugg2013-04-171-2/+2
| | | | | | Rather than as @deprecated. This commit means we can no longer build against 2.10.0.
* Remove CPS dependency from default async implementationPhilipp Haller2013-04-121-34/+3
| | | | | | - move all CPS-related code to `continuations` sub package - fix CPS-based async implementation - enable testing of CPS-based async implementation
* Address deprecation warnings in Scala 2.10.1Jason Zaugg2013-04-101-1/+1
|
* Resolve merge conflictphaller2012-12-191-9/+39
|\
| * New fix for #1861: Add fall-back to CPS for all unsupported uses of awaitphaller2012-12-191-9/+39
| | | | | | | | | | | | | | This is a re-implementation of a previous fix. It is more modular, since it enables the definition of a CPS-based fall-back as a subclass of `AsyncBase`. Thus, it's possible to define fall-back-enabled subclasses of `AsyncBase` targetting not only Scala Futures.
* | Merge pull request #49 from phaller/topic/patmat-partial-functionJason Zaugg2012-12-191-1/+2
|\ \ | |/ |/| Topic/patmat partial function
| * Workaround non-idempotency of typing pattern matching anonymous functions.Jason Zaugg2012-12-101-1/+2
| | | | | | | | | | | | | | - Undo the transformation that takes place in Typers to leave us with Match(EmptyTree, cases). - Make sure we don't descend into the cases of such a tree when peforming the async transform
* | Fix typophaller2012-11-291-3/+3
| |
* | Remove @author tagsphaller2012-11-271-3/+0
|/
* Fix execution context lookup for the trivial async block.Jason Zaugg2012-11-271-1/+1
|
* Fix #26, leaner code gen for `async { <no awaits> }`.Jason Zaugg2012-11-261-9/+20
| | | | We can then use this as a replacement for `Future { expr }`.
* Rewrite the state machine to a class, rather than an object.Jason Zaugg2012-11-261-9/+15
| | | | | | | | | | | | To avoid suprises in tree retyping, the instance of this class is immediately upcase to StateMachine[Promise[T], ExecContext]. Allow nested non-case classes. These pop up when we use nested async calls. Only look for duplicate names in the subtrees traversed by AsyncTraverser.
* Preserve outer This() refs through resetAttrs.Jason Zaugg2012-11-261-11/+9
| | | | | | Adapt the compiler's standard ResetAttrs to keep This() nodes don't refer to a symbol defined in the current async block.
* Synthesize an object implementing Function#apply and resume()Jason Zaugg2012-11-261-28/+44
| | | | | | | | There is a fly in the ointment: any This() trees in the provided code are getting rebound to this class. Sounds like more resetAttrs fun ahead. The object also serves as the Future {} thunk.
* Lift local defs and functions.Jason Zaugg2012-11-261-2/+6
| | | | | | | Any vals referred to in the body of these must also be lifted. Fixes #36
* Refactor some tree creation from Async to ExprBuilder.Jason Zaugg2012-11-241-52/+5
|
* Tiny aesthetic refactorings.Jason Zaugg2012-11-241-2/+2
|
* More small refactorings.Jason Zaugg2012-11-241-1/+1
| | | | Goal is to make ExprBuilder less cluttered.
* Favouring composition over inheritance.Jason Zaugg2012-11-241-6/+5
|
* add missing copyrightJason Zaugg2012-11-241-1/+2
|
* Cleanup var lifting.Jason Zaugg2012-11-241-1/+4
| | | | | Seeing as we know in advance the full set of lifted vars, we don't need to thread this information through ExprBuilder.
* Tightenen up modifiers and other refactoring.Jason Zaugg2012-11-231-3/+3
|
* Fix #31, Unfinished ANF transformJason Zaugg2012-11-231-5/+2
| | | | | | | | Prepend {(); ... } before starting the ANF transform. Add tracing to the anf/inline transform. Also enables and addresses SIP-18 warnings.
* Ensure unique names for definitions in the async block.Jason Zaugg2012-11-231-2/+6
| | | | | | | | - transform the provided tree using reflect.internal.Symbols#Symbol.name_= and treeCopy.{Ident, Select}. - not sure if this is possible within the public Symbol API. - move checking for unsupported nested module/class to AsyncAnalysis. - make block merging selective (only do so if there are nested await calls.)
* Refactor the analyzers to a seprarate file.Jason Zaugg2012-11-221-2/+3
|
* Support match as an expression.Jason Zaugg2012-11-221-3/+3
| | | | | | | | - corrects detection of await calls in the ANF transform. - Split AsyncAnalyzer into two parts. Unsupported await detection must happen prior to the async transform to prevent the ANF lifting out by-name arguments to vals and hence changing the semantics.
* Cleanups and docs.Jason Zaugg2012-11-221-28/+34
| | | | | - Move now-working duplicate definition tests from `neg` to `run`. - Renames and small code beautification around the var lifting analysis
* Remove unused imports.Jason Zaugg2012-11-221-8/+4
|
* Frugality is no longer required with state IDs.Jason Zaugg2012-11-221-4/+13
| | | | | | Change the way state IDs are allocated to avoid the need to ration them out. Also make the logging tolerant of a toolbox setting that doesn't have a source file.
* Minimize lifting of vars.Jason Zaugg2012-11-221-5/+5
|
* Preserve ValDef symbol.Jason Zaugg2012-11-211-0/+4
|
* Only transform if/match-s that contain an await.Jason Zaugg2012-11-211-0/+3
| | | | | | Accurate reporting of misplaced awaits. Attempt to collect the minimal set of vars to lift.
* Slight simplification of in-flight type checking.Jason Zaugg2012-11-211-5/+5
|
* Change type of name mapphaller2012-11-211-1/+2
|
* Clean up and improve debug/error outputphaller2012-11-161-1/+3
|
* Add selective ANF transformphaller2012-11-161-2/+10
| | | | | - Does not descend into class and module defs - Adds several tests, including tests for if-else
* Resolve feature warningsphaller2012-11-121-1/+1
|
* Reduce visibility of members of ExprBuilderphaller2012-11-121-3/+2
|
* Fix doc comment of awaitphaller2012-11-121-7/+7
|
* Add a test to interrogate the expanded tree.Jason Zaugg2012-11-111-1/+1
| | | | | | | - checks that only one function is synthesized - checks the set of vars created (TODO minimize these) - use x$1 rather than x1 for the freshened names for lifted vars. - make execContext a val, not a var.
* Fixes #7, allow async blocks without await or with a single expression.Jason Zaugg2012-11-111-80/+78
|
* Use a var rather than a lazy val to break a cycle.Jason Zaugg2012-11-111-4/+4
| | | | (onCompleteHandler and resume refer to each other)
* Refer to an relevant bug in the comments.Jason Zaugg2012-11-111-1/+1
|
* Collapse all the onComplete handlers into a single function.Jason Zaugg2012-11-111-7/+46
| | | | | | | | We're now down to two inner classes per async block: the `onComplete` function, and the by-name argument to the initial call to `future`. Also caches the execution context in a val.
* Synthezise a match directly.Jason Zaugg2012-11-111-8/+3
| | | | Rather than a function applied to the state.
* Shuffle a bit more code around.Jason Zaugg2012-11-111-4/+2
|
* Synthesize a Function1, rather than a PartialFunction.Jason Zaugg2012-11-111-9/+2
|