{"action":"created","issue":{"url":"https://api.github.com/repos/Place1/node-gir/issues/24","repository_url":"https://api.github.com/repos/Place1/node-gir","labels_url":"https://api.github.com/repos/Place1/node-gir/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/Place1/node-gir/issues/24/comments","events_url":"https://api.github.com/repos/Place1/node-gir/issues/24/events","html_url":"https://github.com/Place1/node-gir/issues/24","id":296154034,"number":24,"title":"Unix specific function","user":{"login":"jamrizzi","id":6234038,"avatar_url":"https://avatars1.githubusercontent.com/u/6234038?v=4","gravatar_id":"","url":"https://api.github.com/users/jamrizzi","html_url":"https://github.com/jamrizzi","followers_url":"https://api.github.com/users/jamrizzi/followers","following_url":"https://api.github.com/users/jamrizzi/following{/other_user}","gists_url":"https://api.github.com/users/jamrizzi/gists{/gist_id}","starred_url":"https://api.github.com/users/jamrizzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamrizzi/subscriptions","organizations_url":"https://api.github.com/users/jamrizzi/orgs","repos_url":"https://api.github.com/users/jamrizzi/repos","events_url":"https://api.github.com/users/jamrizzi/events{/privacy}","received_events_url":"https://api.github.com/users/jamrizzi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-02-11T02:39:28Z","updated_at":"2018-02-11T02:59:50Z","closed_at":null,"author_association":"NONE","body":"Does anyone know why he following Unix specific function was added to the loop initialization in loop.cpp on line 80? I couldn’t figure it out. I’m assuming fd means file descriptor. It seems to me this will make node-gir incompatible with Windows.\r\n\r\nhttps://developer.gnome.org/glib/stable/glib-The-Main-Event-Loop.html#g-source-add-unix-fd\r\n\r\n```c\r\ng_source_add_unix_fd(&source->source, uv_backend_fd(loop), (GIOCondition)(G_IO_IN | G_IO_OUT | G_IO_ERR));\r\n```\r\n\r\nIt appears it was originally added by Jasper St. Pierre\r\n\r\nhttps://github.com/GNOME/gnode/blob/master/src/loop.cc"},"comment":{"url":"https://api.github.com/repos/Place1/node-gir/issues/comments/364715574","html_url":"https://github.com/Place1/node-gir/issues/24#issuecomment-364715574","issue_url":"https://api.github.com/repos/Place1/node-gir/issues/24","id":364715574,"user":{"login":"Place1","id":11731350,"avatar_url":"https://avatars3.githubusercontent.com/u/11731350?v=4","gravatar_id":"","url":"https://api.github.com/users/Place1","html_url":"https://github.com/Place1","followers_url":"https://api.github.com/users/Place1/followers","following_url":"https://api.github.com/users/Place1/following{/other_user}","gists_url":"https://api.github.com/users/Place1/gists{/gist_id}","starred_url":"https://api.github.com/users/Place1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Place1/subscriptions","organizations_url":"https://api.github.com/users/Place1/orgs","repos_url":"https://api.github.com/users/Place1/repos","events_url":"https://api.github.com/users/Place1/events{/privacy}","received_events_url":"https://api.github.com/users/Place1/received_events","type":"User","site_admin":false},"created_at":"2018-02-11T02:59:50Z","updated_at":"2018-02-11T02:59:50Z","author_association":"OWNER","body":"as for the line of code in question, this like adds the UV event loop's backend file descriptor using [uv_backend_fd](http://docs.libuv.org/en/v1.x/loop.html#c.uv_backend_fd) as an event source for the glib event loop. GLib will poll the source and then run through it's loop lifecycle (source prepare, dispatch, etc) for that source when it detects and event.\r\n\r\nIn the context of node-gir, this means that once the UV loop has stuff to run (events pending) GLib will be notified and will execute our `uv_loop_source_funcs`. In the `uv_loop_source_dispatch` function we `uv_run(source->loop, UV_RUN_NOWAIT);` which executes the pending events in the UV loop. This is effectively \"nesting\" the UV loop in the GLib loop.\r\n\r\nThis is only relevant when you want to run a GLib main loop without totally stopping the nodejs (uv) event loop. In [Gtk.js](https://github.com/Place1/node-gir/blob/4f78fc88c5009f62caec0747e93209561678de49/src/Gtk.js#L4) we use this `start_loop` function to get this nesting happening so that when someone calls `gtk.main()` it won't block things such as Promises, setTimeout, setInterval, I/O callbacks, etc from executing."}}
{"actor":{"display_login":"Place1"}}