Closed ng2dev closed 4 years ago
I did understand by now that the sig key word generates the subscriber methods - unfortunately that sig method does not exist in the ALMemory interface.
Thanks, this is an excellent question! Looking at the documentation, it seems the subscriber
method return an object but qiloop scan
did not generate the IDL for this object (since it is not a service and qiloop scan only look at services).
We need to scan
this object to get a description of it and then update the IDL description of ALMemory (just like LogManager which returns a log listener).
Here is a blind fix (sorry i don't have time right now). It seems this object have a signal called "signal" which is of type a Value type.
interface Subscriber
sig signal(data: any)
end
interface ALMemory
[...]
fn subscriber(eventName: str) -> Subscriber
[...]
end
I hope this makes sense. i will come back to you when i can. http://doc.aldebaran.com/2-5/naoqi/core/almemory-api.html#ALMemoryProxy::subscriber__ssCR
Ha you are right that was the trick - I added a working example to the PR.
Thanks a lot, I love the "ouch" example !
I am trying to implement this example of a memory service subscription and a callback function like referenced in this python example.
I am trying to understand how to subscribe to that memory service signal through examples/signals/main.go where you subscribe to a serviceAdded callback channel that seems similar to the related functions inside the ALMemoryInterface
What I don't understand is that the services.idl file does not contain the subscribe methods for the serviceAdded example - so how is that subscribeServiceAdded method being generated inside bus/services/gen_proxy.go - so that I could run something similar to this:
Thanks for your help!