fresh-borzoni opened a new issue, #456:
URL: https://github.com/apache/fluss-rust/issues/456

   ### Search before asking
   
   - [x] I searched in the 
[issues](https://github.com/apache/fluss-rust/issues) and found nothing similar.
   
   
   ### Description
   
   Add __aenter__ / __aexit__ to AppendWriter, UpsertWriter, and LogScanner to 
ensure proper resource cleanup.                                                 
                                                                                
       
                     
     Writers (AppendWriter, UpsertWriter):                                      
                                                                                
                                                                                
        
     - __aexit__ on normal exit: flush() then close
     - __aexit__ on exception: close without flush (don't send partial data)    
                                                                                
                                                                                
        
      
     Scanners (LogScanner):                                                     
                                                                                
                                                                                
        
     - __aexit__: close
      
   ```python                                                                    
                                                                                
                                                                                
              
     async with table.new_append().create_writer() as writer:
         writer.append(row1)                                                    
                                                                                
                                                                                
        
         writer.append(row2)
     # auto-flush + close
                                                                                
                                                                                
                                                                                
        
     async with table.new_scan().create_log_scanner() as scanner:
         scanner.subscribe(0, EARLIEST_OFFSET)                                  
                                                                                
                                                                                
        
         records = scanner.poll(1000)
     # auto-close
   ```
   
   ### Willingness to contribute
   
   - [ ] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to