Skip to content

Commit 841f4df

Browse files
committed
Deprecate support for Reactor 2 promises. Fixes #10247
Since Reactor 2 is largely abandoned and Reactor 3 is a complete re-write, it has been decided that Reactor will be completely pulled from the codebase in the future and the Events framework re-written on-top of either RxJava or the regular Spring event publisher. Given this stance it makes sense to deprecate all related Reactor classes now so that users can consider this migration for the future.
1 parent 57d047b commit 841f4df

File tree

4 files changed

+12
-18
lines changed

4 files changed

+12
-18
lines changed

grails-async/src/main/groovy/grails/async/Promises.groovy

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,14 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package grails.async;
16+
package grails.async
1717

18+
import grails.async.decorator.PromiseDecorator
19+
import groovy.transform.CompileStatic
20+
import org.grails.async.factory.SynchronousPromiseFactory
21+
import org.grails.async.factory.gpars.GparsPromiseFactory
1822

19-
import groovy.lang.Closure
20-
import groovy.transform.CompileStatic;
21-
22-
import java.util.List;
23-
import java.util.Map;
24-
import java.util.concurrent.TimeUnit;
25-
26-
import grails.async.decorator.PromiseDecorator;
27-
import org.grails.async.factory.SynchronousPromiseFactory;
28-
import org.grails.async.factory.gpars.GparsPromiseFactory;
29-
import org.grails.async.factory.reactor.ReactorPromiseFactory;
23+
import java.util.concurrent.TimeUnit
3024

3125
/**
3226
* Factory class for working with {@link Promise} instances

grails-async/src/main/groovy/org/grails/async/factory/reactor/ReactorPromise.groovy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,11 @@ import java.util.concurrent.TimeoutException
3131
*
3232
* @author Graeme Rocher
3333
* @since 3.0
34+
*
35+
* @deprecated Reactor promise integration is deprecated and will be removed in a future version of Grails
3436
*/
3537
@CompileStatic
38+
@Deprecated
3639
class ReactorPromise<T> implements Promise<T> {
3740

3841
reactor.rx.Promise<T> internalPromise

grails-async/src/main/groovy/org/grails/async/factory/reactor/ReactorPromiseFactory.groovy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,11 @@ import java.util.concurrent.TimeUnit
3131
*
3232
* @author Graeme Rocher
3333
* @since 3.0
34+
*
35+
* @deprecated Reactor promise integration is deprecated and will be removed in a future version of Grails
3436
*/
3537
@CompileStatic
38+
@Deprecated
3639
class ReactorPromiseFactory extends AbstractPromiseFactory {
3740
static final boolean REACTOR_PRESENT
3841
static {

grails-plugin-async/src/main/groovy/org/grails/plugins/web/async/ControllersAsyncGrailsPlugin.groovy

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,11 @@ class ControllersAsyncGrailsPlugin extends Plugin {
3535

3636
Closure doWithSpring() {{->
3737
asyncPromiseResponseActionResultTransformer(AsyncActionResultTransformer)
38-
3938
}}
4039

4140
@Override
4241
@CompileStatic
4342
void doWithDynamicMethods() {
44-
try {
45-
Promises.promiseFactory = new ReactorPromiseFactory(applicationContext.getBean(Environment))
46-
} catch (NoSuchBeanDefinitionException e) {
47-
// Reactor not configured
48-
}
4943
Promises.promiseFactory.addPromiseDecoratorLookupStrategy(new WebRequestPromiseDecoratorLookupStrategy())
5044
}
5145

0 commit comments

Comments
 (0)