osx delegate-wrapping has me stumped. Anyone have experience or can point me in the right direction?
I really need minimal x-platform download progress for a project. To my knowledge no nim lib exists that allows this, but puppy is the closest. It would be ideal to also implement upload progress, but I figure one thing at a time. Also, download progress is far more common of a need than upload progress -- so a phased development doesn't seem horrible.
What's working in this PR:
linux libcurl download progress callback
windows WinHTTP download progress callback
What's broken:
Instead of including my attempt for macOS, I've left it untouched. This means it will not compile right now due to breaking signature changes elsewhere.
Features:
very simple download progress callbacks (total, current: int; an optional user pointer) trying to keep with puppy's minimalism
could be extended to support upload callbacks later in the same way
Assumptions:
The user is responsible for caring about concurrency, if it's important to them. But this is easy enough.
What needs help or guidance:
how can the objc code in this repo be used to create a delegate for the NSURLConnectionDelegate type?
It looks like everything necessary is there to make this relatively easy. I have some guesses about how to use the templates, but there's a complex dance of declarations and registrations that needs to happen, and I'm at a loss. So far I've been looking into other delegate wrappers for understanding, like in the older nim objc project by jangko, and rust's objc wrapper.
Maybe there's a better/shorter name for the type than ProgressCallback? I don't like how long it is, but it is at least descriptive.
Summary:
I really need minimal x-platform download progress for a project. To my knowledge no nim lib exists that allows this, but puppy is the closest. It would be ideal to also implement upload progress, but I figure one thing at a time. Also, download progress is far more common of a need than upload progress -- so a phased development doesn't seem horrible.
What's working in this PR:
libcurl
download progress callbackWinHTTP
download progress callbackWhat's broken: Instead of including my attempt for macOS, I've left it untouched. This means it will not compile right now due to breaking signature changes elsewhere.
Features:
Assumptions:
What needs help or guidance:
NSURLConnectionDelegate
type? It looks like everything necessary is there to make this relatively easy. I have some guesses about how to use the templates, but there's a complex dance of declarations and registrations that needs to happen, and I'm at a loss. So far I've been looking into other delegate wrappers for understanding, like in the older nim objc project by jangko, and rust's objc wrapper.ProgressCallback
? I don't like how long it is, but it is at least descriptive.