godot-dispatch-queue icon indicating copy to clipboard operation
godot-dispatch-queue copied to clipboard

Create new asset in Asset Library for Dispatch Queue with Godot 4 support

Open gilzoide opened this issue 1 year ago • 5 comments

gilzoide avatar Feb 10 '24 23:02 gilzoide

Hmm I'm also running into similar problems as before for some reason:

E 0:00:07:0282   dispatch_queue.gd:90 @ execute(): Error calling from signal 'finished' to callable: 'StaticBody3D::_generated_chunk': Method expected 0 arguments, but called with 1.
  <C++ Source>   core/object/object.cpp:1140 @ emit_signalp()
  <Stack Trace>  dispatch_queue.gd:90 @ execute()
                 dispatch_queue.gd:253 @ _run_loop()
Screenshot 2024-02-11 at 14 51 31 Screenshot 2024-02-11 at 14 51 42

For some reason Godot no longer allows signals to be emitted from Threads 🤔

I see that there is now set_thread_safety_checks_enabled(false) which should allow doing so.

tavurth avatar Feb 11 '24 06:02 tavurth

For now this code I wrote will fill my use case, but has to be added as a child to work:

https://gist.github.com/tavurth/f3d93b428e5ea4b15d9b7566581e10b4

So basically waiting until the thread is finished (on the main thread) in _physics_process to emit signals.

It's a shame, but I guess this way is more thread safe.

tavurth avatar Feb 11 '24 07:02 tavurth

Hi @tavurth.

Error calling from signal 'finished' to callable: 'StaticBody3D::_generated_chunk': Method expected 0 arguments, but called with 1

It seems the method you hooked into the finished signal breaks if you pass arguments to it. I guess if you connect a method that accepts the argument, even if just ignoring it, it should work fine.

gilzoide avatar Feb 11 '24 15:02 gilzoide

By the way, this issue is about creating a new asset in the Asset Store. If you want to further discuss this problem you arised, I'll ask you to create a new Issue or Discussion for it, to avoid discussions out of the issue's topic.

gilzoide avatar Feb 11 '24 15:02 gilzoide

Hi @tavurth.

Error calling from signal 'finished' to callable: 'StaticBody3D::_generated_chunk': Method expected 0 arguments, but called with 1

It seems the method you hooked into the finished signal breaks if you pass arguments to it. I guess if you connect a method that accepts the argument, even if just ignoring it, it should work fine.

Wow I must be needing sleep more than I thought 😅 I didn't notice that and assumed it was another issue! Thank you!

tavurth avatar Feb 11 '24 21:02 tavurth