@@ -55,14 +55,14 @@ public static Continuation create(SuspendableRunnable o) {
5555 /**
5656 * Creates a suspended continuation, {@link SuspendableRunnable} is not started
5757 * @param o a continuable code block
58- * @param optimized
58+ * @param singleShot
5959 * If true then continuation constructed is performance-optimized but
60- * may be resumed only once. Otherwise "restartable" continuation is created that may
60+ * may be resumed only once. Otherwise multi-shot continuation is created that may
6161 * be resumed multiple times.
6262 * @return the continuation, suspended before code starts
6363 */
64- public static Continuation create (SuspendableRunnable o , boolean optimized ) {
65- return Continuation .startSuspendedWith (toRunnable (o ), optimized );
64+ public static Continuation create (SuspendableRunnable o , boolean singleShot ) {
65+ return Continuation .startSuspendedWith (toRunnable (o ), singleShot );
6666 }
6767
6868
@@ -87,14 +87,14 @@ public static Continuation start(SuspendableRunnable o) {
8787 * is not suspended.
8888 *
8989 * @param o a continuable code block
90- * @param optimized
90+ * @param singleShot
9191 * If true then continuation constructed is performance-optimized but
92- * may be resumed only once. Otherwise "restartable" continuation is created that may
92+ * may be resumed only once. Otherwise multi-shot continuation is created that may
9393 * be resumed multiple times.
9494 * @return the first continuation suspended
9595 */
96- public static Continuation start (SuspendableRunnable o , boolean optimized ) {
97- return start (o , null , optimized );
96+ public static Continuation start (SuspendableRunnable o , boolean singleShot ) {
97+ return start (o , null , singleShot );
9898 }
9999
100100 /**
@@ -119,14 +119,14 @@ public static Continuation start(SuspendableRunnable o, Object ctx) {
119119 *
120120 * @param o a continuable code block
121121 * @param ctx an initial argument for the continuable code
122- * @param optimized
122+ * @param singleShot
123123 * If true then continuation constructed is performance-optimized but
124- * may be resumed only once. Otherwise "restartable" continuation is created that may
124+ * may be resumed only once. Otherwise multi-shot continuation is created that may
125125 * be resumed multiple times.
126126 * @return the first continuation suspended
127127 */
128- public static Continuation start (SuspendableRunnable o , Object ctx , boolean optimized ) {
129- return Continuation .startWith (toRunnable (o ), ctx , optimized );
128+ public static Continuation start (SuspendableRunnable o , Object ctx , boolean singleShot ) {
129+ return Continuation .startWith (toRunnable (o ), ctx , singleShot );
130130 }
131131
132132
@@ -152,7 +152,7 @@ public static <T> CloseableIterator<T> iteratorOf(Continuation coroutine) {
152152 * @return the iterator over emitted values
153153 */
154154 public static <T > CloseableIterator <T > iteratorOf (Continuation coroutine , boolean useCurrentValue ) {
155- return new ContinuationIterator <>(coroutine .optimized (), useCurrentValue );
155+ return new ContinuationIterator <>(coroutine .singleShot (), useCurrentValue );
156156 }
157157
158158
@@ -290,7 +290,7 @@ public static <T> void forEachReply(Continuation coroutine, Function<? super T,
290290 * resume coroutine.
291291 */
292292 public static <T > void forEachReply (Continuation coroutine , boolean useCurrentValue , Function <? super T , ?> action ) {
293- Continuation cc = coroutine .optimized ();
293+ Continuation cc = coroutine .singleShot ();
294294 try {
295295 Object param = null ;
296296 if (null != cc && useCurrentValue ) {
@@ -410,7 +410,7 @@ public static <T> void forEachReply(SuspendableRunnable coroutine, Function<? su
410410 * resume coroutine.
411411 */
412412 public static @ continuable <T > void forEachReply$ (Continuation coroutine , boolean useCurrentValue , SuspendableFunction <? super T , ?> action ) {
413- Continuation cc = coroutine .optimized ();
413+ Continuation cc = coroutine .singleShot ();
414414 try {
415415 Object param = null ;
416416 if (null != cc && useCurrentValue ) {
0 commit comments