File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed 
zio-kafka/src/main/scala/zio/kafka/consumer/internal Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -9,16 +9,18 @@ private[consumer] object RunloopExecutor {
99
1010  private  val  counter :  AtomicLong  =  new  AtomicLong (0 )
1111
12-   private  def  newSingleThreadedExecutor ( i :  Long ) :  ZIO [Scope , Throwable , Executor ] = 
12+   private  val  newSingleThreadedExecutor :  ZIO [Scope , Throwable , Executor ] = 
1313    ZIO .acquireRelease {
1414      ZIO .attempt {
1515        val  javaExecutor  = 
16-           Executors .newSingleThreadExecutor(runnable =>  new  Thread (runnable, s " zio-kafka-runloop-thread- $i" ))
16+           Executors .newSingleThreadExecutor { runnable => 
17+             new  Thread (runnable, s " zio-kafka-runloop-thread- ${counter.getAndIncrement()}" )
18+           }
1719
1820        Executor .fromJavaExecutor(javaExecutor) ->  javaExecutor
1921      }
2022    } { case  (_, executor) =>  ZIO .attempt(executor.shutdown()).orDie }.map(_._1)
2123
22-   val  newInstance :  ZIO [Scope , Throwable , Executor ] =  newSingleThreadedExecutor(counter.getAndIncrement()) 
24+   val  newInstance :  ZIO [Scope , Throwable , Executor ] =  newSingleThreadedExecutor
2325
2426}
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments