Why do you think it worth exposing WriteHandler and ReadHandler? My concern is that it makes API of the library is more hairy with no benefit for the user. User passed that functions to the library, why user would like to get them back?
Maybe to replace them on the go? But it leads to race condition when handler is executed and replaced at the same time?
OnError though looks interesting, except it should be SetErrorHandler or something so we can put proper locking.
What do you think?
And thank you for the diff, sorry for slow response again. Life happens :)
Hi,
Sorry for such a long delay with the answer!
Why do you think it worth exposing
WriteHandler
andReadHandler
? My concern is that it makes API of the library is more hairy with no benefit for the user. User passed that functions to the library, why user would like to get them back?Maybe to replace them on the go? But it leads to race condition when handler is executed and replaced at the same time?
OnError
though looks interesting, except it should beSetErrorHandler
or something so we can put proper locking.What do you think?
And thank you for the diff, sorry for slow response again. Life happens :)