-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using native code #79
Comments
Hey, I have never done anything with |
Hey Yeah it is, there are 100s of 1000s of apps/packages that use ffi, I think technically it's part of Node, it certainly started out that way. I've made a very simple reproduction here |
To add to this, i also can't require('electron') from my client code either for the same reason really. I feel like I'm fundamentally missing something and that this is probably easy to fix, but i could be wrong. Do i have to do these sorts of things in modules perhaps? |
Sorry for the delay. I have finally checked it out. Here is an example of declaring IPC method which can be called from your meteor client with https://github.com/wojtkowiak/meteor-desktop/blob/master/scaffold/modules/example/index.js#L51 Let me know if will have any more problems with it as I did not have enough time to check if there actually would be any problems with |
I thought it must be a meteor/electron mismatch somewhere. I had a look at modules but I couldn't figure out how they worked or how to use them. After spending the morning figuring it out i finally have it working. Thank you so much for your help, it's really awesome work you're doing. It looks like ffi works exactly as expected so It looks like it's all good from here. |
@crippledjosh Please let others know what you did to have it working. |
@ericvrp I did exactly what you said, as it happens I posted what you just said to a different thread, but forgot to post it here. Yeah seems to be a documentation issue. |
When I run But when I run Running both fetches on seperate lines of the developer console gives the expected "1) true". Any idea why this is happening? |
Ahhh i have actually had this issue, but I wasn't certain what it was. My theory is that there is an issue with the queue and fetchId. I think if you ran your fetch requests with some sort of time delay on the second one it would work, which is why it works in the console, because obviously you're not asking them within milliseconds of each other anymore. If I'm correct it's gonna be a bitch to debug, because as soon as you stop for the debug the issue will stop. |
When I run this from my Meteor client side. When I do a console.log(fetchId) in the testEvent handler I see the fetchId increment so at least we know that.
EDIT: But on the console I only see the first result followed by two timeouts |
For me this seems like a serious bug. Will investigate it asap. |
Thank you and yes I agree this bug would make it very hard to use meteor-desktop at the moment |
Sorry, one more thing to help you track down the problem. I added another desktop module, this time with two event handlers. As long as I try to call Meteor.fetch on either of the three handlers things work but a second time causes a timeout. So with handler1,handler2,handler3,handler1 only the last handler1 fetch causes a timeout. |
Thanks @ericvrp for your time. This will be fixed in |
Great! And thank you for your time developing this package! When 0.7.1 arrives I will give it a shake and report here. |
@wojtkowiak Out of curiosity what was the issue? I was having a dig around in the code to see if I could help out at all, and didn't get very far, I wasn't looking very long, but still I'm interested. |
@crippledjosh Well I have changed the conception in the middle while writing the wrapper and decided I will handle What I wanted to do originally is to check whether the handler did process the event (handler checks if the Now I simply added the |
Ahhh ok cool. I was pretty close with my guess on what was going on then, thats nice 👍 . No worries, what you've got is awesome and I'm really grateful for all the work you do. |
All fine now in 0.7.1 |
Great, can this be closed? |
yes it can |
It says in the docs that it fully supports native modules, but I cannot figure out how to use ffi at all as soon as I import it i get an except that 'TypeError: exists is not a function(…)' and after a little digging it just looks like thats because the node modules that ffi relies on have not been loaded specifically fs (from which it extracts the 'exists' function). Am i being stupid, is that not what was meant by native modules or is this a specific issue with loading ffi (i think its actually bindings which is needed by ffi)?
Thanks,
The text was updated successfully, but these errors were encountered: