In async mode, worker thread can now execute an optional teardown callback upon exit.
(Note: this can be helpful when a custom sink invokes a JNI callback, which implies that worker thread was previously attached to JVM, and needs to be cleanly detached upon exit)
This commit is contained in:
		@@ -53,7 +53,10 @@ void set_level(level::level_enum log_level);
 | 
			
		||||
// worker_warmup_cb (optional):
 | 
			
		||||
//     callback function that will be called in worker thread upon start (can be used to init stuff like thread affinity)
 | 
			
		||||
//
 | 
			
		||||
void set_async_mode(size_t queue_size, const async_overflow_policy overflow_policy = async_overflow_policy::block_retry, const std::function<void()>& worker_warmup_cb = nullptr, const std::chrono::milliseconds& flush_interval_ms = std::chrono::milliseconds::zero());
 | 
			
		||||
// worker_teardown_cb (optional):
 | 
			
		||||
//     callback function that will be called in worker thread upon exit
 | 
			
		||||
//
 | 
			
		||||
void set_async_mode(size_t queue_size, const async_overflow_policy overflow_policy = async_overflow_policy::block_retry, const std::function<void()>& worker_warmup_cb = nullptr, const std::chrono::milliseconds& flush_interval_ms = std::chrono::milliseconds::zero(), const std::function<void()>& worker_teardown_cb = nullptr);
 | 
			
		||||
 | 
			
		||||
// Turn off async mode
 | 
			
		||||
void set_sync_mode();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user