@@ -250,7 +250,7 @@ describe("Runner", () => {
250250 Effect . gen ( function * ( ) {
251251 const s = yield * Scope . Scope
252252 const runner = Runner . make < string > ( s )
253- const result = yield * runner . startShell ( ( _signal ) => Effect . succeed ( "shell-done" ) )
253+ const result = yield * runner . startShell ( Effect . succeed ( "shell-done" ) )
254254 expect ( result ) . toBe ( "shell-done" )
255255 expect ( runner . busy ) . toBe ( false )
256256 } ) ,
@@ -264,7 +264,7 @@ describe("Runner", () => {
264264 const fiber = yield * runner . ensureRunning ( Effect . never . pipe ( Effect . as ( "x" ) ) ) . pipe ( Effect . forkChild )
265265 yield * Effect . sleep ( "10 millis" )
266266
267- const exit = yield * runner . startShell ( ( _s ) => Effect . succeed ( "nope" ) ) . pipe ( Effect . exit )
267+ const exit = yield * runner . startShell ( Effect . succeed ( "nope" ) ) . pipe ( Effect . exit )
268268 expect ( Exit . isFailure ( exit ) ) . toBe ( true )
269269
270270 yield * runner . cancel
@@ -279,12 +279,10 @@ describe("Runner", () => {
279279 const runner = Runner . make < string > ( s )
280280 const gate = yield * Deferred . make < void > ( )
281281
282- const sh = yield * runner
283- . startShell ( ( _signal ) => Deferred . await ( gate ) . pipe ( Effect . as ( "first" ) ) )
284- . pipe ( Effect . forkChild )
282+ const sh = yield * runner . startShell ( Deferred . await ( gate ) . pipe ( Effect . as ( "first" ) ) ) . pipe ( Effect . forkChild )
285283 yield * Effect . sleep ( "10 millis" )
286284
287- const exit = yield * runner . startShell ( ( _s ) => Effect . succeed ( "second" ) ) . pipe ( Effect . exit )
285+ const exit = yield * runner . startShell ( Effect . succeed ( "second" ) ) . pipe ( Effect . exit )
288286 expect ( Exit . isFailure ( exit ) ) . toBe ( true )
289287
290288 yield * Deferred . succeed ( gate , undefined )
@@ -302,37 +300,26 @@ describe("Runner", () => {
302300 } ,
303301 } )
304302
305- const sh = yield * runner
306- . startShell ( ( signal ) =>
307- Effect . promise (
308- ( ) =>
309- new Promise < string > ( ( resolve ) => {
310- signal . addEventListener ( "abort" , ( ) => resolve ( "aborted" ) , { once : true } )
311- } ) ,
312- ) ,
313- )
314- . pipe ( Effect . forkChild )
303+ const sh = yield * runner . startShell ( Effect . never . pipe ( Effect . as ( "aborted" ) ) ) . pipe ( Effect . forkChild )
315304 yield * Effect . sleep ( "10 millis" )
316305
317- const exit = yield * runner . startShell ( ( _s ) => Effect . succeed ( "second" ) ) . pipe ( Effect . exit )
306+ const exit = yield * runner . startShell ( Effect . succeed ( "second" ) ) . pipe ( Effect . exit )
318307 expect ( Exit . isFailure ( exit ) ) . toBe ( true )
319308
320309 yield * runner . cancel
321310 const done = yield * Fiber . await ( sh )
322- expect ( Exit . isSuccess ( done ) ) . toBe ( true )
311+ expect ( Exit . isFailure ( done ) ) . toBe ( true )
323312 } ) ,
324313 )
325314
326315 it . live (
327- "cancel interrupts shell that ignores abort signal " ,
316+ "cancel interrupts shell" ,
328317 Effect . gen ( function * ( ) {
329318 const s = yield * Scope . Scope
330319 const runner = Runner . make < string > ( s )
331320 const gate = yield * Deferred . make < void > ( )
332321
333- const sh = yield * runner
334- . startShell ( ( _signal ) => Deferred . await ( gate ) . pipe ( Effect . as ( "ignored" ) ) )
335- . pipe ( Effect . forkChild )
322+ const sh = yield * runner . startShell ( Deferred . await ( gate ) . pipe ( Effect . as ( "ignored" ) ) ) . pipe ( Effect . forkChild )
336323 yield * Effect . sleep ( "10 millis" )
337324
338325 const stop = yield * runner . cancel . pipe ( Effect . forkChild )
@@ -356,9 +343,7 @@ describe("Runner", () => {
356343 const runner = Runner . make < string > ( s )
357344 const gate = yield * Deferred . make < void > ( )
358345
359- const sh = yield * runner
360- . startShell ( ( _signal ) => Deferred . await ( gate ) . pipe ( Effect . as ( "shell-result" ) ) )
361- . pipe ( Effect . forkChild )
346+ const sh = yield * runner . startShell ( Deferred . await ( gate ) . pipe ( Effect . as ( "shell-result" ) ) ) . pipe ( Effect . forkChild )
362347 yield * Effect . sleep ( "10 millis" )
363348 expect ( runner . state . _tag ) . toBe ( "Shell" )
364349
@@ -384,9 +369,7 @@ describe("Runner", () => {
384369 const calls = yield * Ref . make ( 0 )
385370 const gate = yield * Deferred . make < void > ( )
386371
387- const sh = yield * runner
388- . startShell ( ( _signal ) => Deferred . await ( gate ) . pipe ( Effect . as ( "shell" ) ) )
389- . pipe ( Effect . forkChild )
372+ const sh = yield * runner . startShell ( Deferred . await ( gate ) . pipe ( Effect . as ( "shell" ) ) ) . pipe ( Effect . forkChild )
390373 yield * Effect . sleep ( "10 millis" )
391374
392375 const work = Effect . gen ( function * ( ) {
@@ -414,16 +397,7 @@ describe("Runner", () => {
414397 const runner = Runner . make < string > ( s )
415398 const gate = yield * Deferred . make < void > ( )
416399
417- const sh = yield * runner
418- . startShell ( ( signal ) =>
419- Effect . promise (
420- ( ) =>
421- new Promise < string > ( ( resolve ) => {
422- signal . addEventListener ( "abort" , ( ) => resolve ( "aborted" ) , { once : true } )
423- } ) ,
424- ) ,
425- )
426- . pipe ( Effect . forkChild )
400+ const sh = yield * runner . startShell ( Effect . never . pipe ( Effect . as ( "aborted" ) ) ) . pipe ( Effect . forkChild )
427401 yield * Effect . sleep ( "10 millis" )
428402
429403 const run = yield * runner . ensureRunning ( Effect . succeed ( "y" ) ) . pipe ( Effect . forkChild )
@@ -478,7 +452,7 @@ describe("Runner", () => {
478452 const runner = Runner . make < string > ( s , {
479453 onBusy : Ref . update ( count , ( n ) => n + 1 ) ,
480454 } )
481- yield * runner . startShell ( ( _signal ) => Effect . succeed ( "done" ) )
455+ yield * runner . startShell ( Effect . succeed ( "done" ) )
482456 expect ( yield * Ref . get ( count ) ) . toBe ( 1 )
483457 } ) ,
484458 )
@@ -509,9 +483,7 @@ describe("Runner", () => {
509483 const runner = Runner . make < string > ( s )
510484 const gate = yield * Deferred . make < void > ( )
511485
512- const fiber = yield * runner
513- . startShell ( ( _signal ) => Deferred . await ( gate ) . pipe ( Effect . as ( "ok" ) ) )
514- . pipe ( Effect . forkChild )
486+ const fiber = yield * runner . startShell ( Deferred . await ( gate ) . pipe ( Effect . as ( "ok" ) ) ) . pipe ( Effect . forkChild )
515487 yield * Effect . sleep ( "10 millis" )
516488 expect ( runner . busy ) . toBe ( true )
517489
0 commit comments