Skip to content

Gd<T> cannot be passed as a parameter in async signals. #1074

Closed
@ColinWttt

Description

@ColinWttt

It is unrelated to whether the signal is type-safe.

     #[signal]
     fn custom_signal_gd(value: Gd<RefCounted>);

This comes from the Send + Sync bounds here:

pub struct SignalFuture<R: ParamTuple + Sync + Send>(FallibleSignalFuture<R>);

Those bounds are unnecessary for signals that are emitted on the main thread. (Awaiting must anyway happen on the main thread).

Was the intention here to support also signals emitted on other threads, as a cross-thread communication mechanism? If yes, we should probably add this later -- might need more thought regarding thread safety, and probably some version of #18.

Originally posted by @Bromeon in #1043 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: coreCore componentsquality-of-lifeNo new functionality, but improves ergonomics/internals

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions