Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: fb2k API questions (Read 15413 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: fb2k API questions

Reply #50
The http_client object is just an entrypoint for creating request objects so you can call http_client::get()->create_request(...) it from any thread you like.
Individual request and reply objects are not thread safe, that is you should synchronize if you want to call methods of the same object from different threads, which probably isn't what you want as I have no idea why anyone would do such thing.
Microsoft Windows: We can't script here, this is bat country.

Re: fb2k API questions

Reply #51
I was thinking of off-loading web access to a worker thread, so this works out nicely for me =)
Thanks!

A similar question, but regarding album_art_extractor_instance::query and album_art_extractor_instance_v2::query_paths (>link<). Can it be used safely off the main thread as well?


 

Re: fb2k API questions

Reply #53
If something takes an abort_callback&, it's designed for use in worker threads.

I'm cleaning the documentation up, I'll add info about all these.

I know it's not a pretty way of determining what is safe to call and what isn't, but I made most of main-thread-only-by-design functions crash/bugcheck if called from another thread.
Microsoft Windows: We can't script here, this is bat country.

Re: fb2k API questions

Reply #54
If something takes an abort_callback&, it's designed for use in worker threads.
Nice! Now I don't have to bug you about each and every API point :D
Thanks =)

Your async album art methods in SMP inherited from JSP and originally WSH panel are already doing that.
Right! That's what I get for not servicing my code for too long...