I commented on https://github.com/JuliaLang/Reactive.jl/issues/99 with some 
information about slots not being executed twice unless there's a delay. 

The disconnect problem is a type error on your first parameter. I think you 
meant to have this:
function disconnect(signal::Reactive.Signal, slot::Slot)
  ...
end

To get `disconnect` to work correctly, I think you need to keep a 
collection of the Signal objects returned from `connect` so that you can 
call `unpreserve` and `close` on those objects.

The same collection of Signal objects needed to handle `disconnect` will 
also provide an obvious way to handle `is_connected`.

I'm not sure how (or even if) `emit` could be changed to allow it to pass 
positional and keyword arguments using Reactive. My understanding of 
Reactive is that it operates on single values (which also includes Tuples, 
Dicts, user-defined types, etc.). I think this is pointing at a fundamental 
difference between treating signals as a declarative graph (the Reactive 
approach) and treating them as in-process RPC (the Qt approach). You could 
still get somewhat similar behavior out of Reactive by having all slots 
accept a single tuple of this form:
(arg1,arg2,arg3,Dict())

...but then each slot would have to manually destructure the tuple to use 
it. All slots would have the same signature as well, which breaks part of 
the beauty of "slots are just normal functions" that Qt and Boost allow. 
That said, there might be some obvious solution I'm not seeing, such as a 
wrapper object holding the slot function, or something like that.

On Friday, June 3, 2016 at 12:34:37 AM UTC-5, Femto Trader wrote:
>
> This implementation have some issue
>
> emit is not able to pass arguments (positionnal arguments and keyword 
> arguments)
> I don't know how to implement is_connected
> Removing comments for disconnect raises an error.
> If there isn't enough delay between 2 emit calls... slots are not executed 
> twice as they should !
>
> Any idea to fix these issues ?
>

Reply via email to