{"action":"created","issue":{"url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/1969","repository_url":"https://api.github.com/repos/rmosolgo/graphql-ruby","labels_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/1969/labels{/name}","comments_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/1969/comments","events_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/1969/events","html_url":"https://github.com/rmosolgo/graphql-ruby/issues/1969","id":383351654,"node_id":"MDU6SXNzdWUzODMzNTE2NTQ=","number":1969,"title":"Multiplex not running concurrently ","user":{"login":"DamirSvrtan","id":1437202,"node_id":"MDQ6VXNlcjE0MzcyMDI=","avatar_url":"https://avatars0.githubusercontent.com/u/1437202?v=4","gravatar_id":"","url":"https://api.github.com/users/DamirSvrtan","html_url":"https://github.com/DamirSvrtan","followers_url":"https://api.github.com/users/DamirSvrtan/followers","following_url":"https://api.github.com/users/DamirSvrtan/following{/other_user}","gists_url":"https://api.github.com/users/DamirSvrtan/gists{/gist_id}","starred_url":"https://api.github.com/users/DamirSvrtan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DamirSvrtan/subscriptions","organizations_url":"https://api.github.com/users/DamirSvrtan/orgs","repos_url":"https://api.github.com/users/DamirSvrtan/repos","events_url":"https://api.github.com/users/DamirSvrtan/events{/privacy}","received_events_url":"https://api.github.com/users/DamirSvrtan/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-11-22T01:49:27Z","updated_at":"2018-11-28T21:21:53Z","closed_at":"2018-11-28T13:54:38Z","author_association":"NONE","body":"Hi @rmosolgo! 👋First of all, thank you for your hard work!\r\n\r\nThe guides mention that the multiplex method executes queries **concurrently** however that is not what I am seeing (or I am maybe doing something wrong).\r\n\r\nI am referencing this part of the guides: http://graphql-ruby.org/queries/multiplex.html#concurrent-execution\r\n\r\nI've created a simple example:\r\n\r\n```ruby\r\nrequire 'graphql'\r\n\r\nclass MyQuery < GraphQL::Schema::Object\r\n  field :sleeping, Integer, null: true\r\n\r\n  def sleeping\r\n     sleep 5\r\n  end\r\nend\r\n\r\nclass MySchema < GraphQL::Schema\r\n  query(MyQuery)\r\nend\r\n\r\nquery_string = <<~HEREDOC\r\n  query {\r\n    sleeping\r\n  }\r\nHEREDOC\r\n\r\nputs MySchema.multiplex(\r\n  [{ query: query_string }, { query: query_string }]\r\n).to_json\r\n```\r\n\r\nI should be getting execution time somewhat over 5 seconds, not over 10 seconds.\r\n\r\n```shell\r\ntime ruby bench-multiplex.rb\r\n[{\"data\":{\"sleeping\":5}},{\"data\":{\"sleeping\":5}}]\r\nruby bench-multiplex.rb  0.36s user 0.12s system 4% cpu 10.523 total\r\n```\r\n\r\nDo you know what I might be doing wrong?"},"comment":{"url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/comments/442609166","html_url":"https://github.com/rmosolgo/graphql-ruby/issues/1969#issuecomment-442609166","issue_url":"https://api.github.com/repos/rmosolgo/graphql-ruby/issues/1969","id":442609166,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MjYwOTE2Ng==","user":{"login":"DamirSvrtan","id":1437202,"node_id":"MDQ6VXNlcjE0MzcyMDI=","avatar_url":"https://avatars0.githubusercontent.com/u/1437202?v=4","gravatar_id":"","url":"https://api.github.com/users/DamirSvrtan","html_url":"https://github.com/DamirSvrtan","followers_url":"https://api.github.com/users/DamirSvrtan/followers","following_url":"https://api.github.com/users/DamirSvrtan/following{/other_user}","gists_url":"https://api.github.com/users/DamirSvrtan/gists{/gist_id}","starred_url":"https://api.github.com/users/DamirSvrtan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DamirSvrtan/subscriptions","organizations_url":"https://api.github.com/users/DamirSvrtan/orgs","repos_url":"https://api.github.com/users/DamirSvrtan/repos","events_url":"https://api.github.com/users/DamirSvrtan/events{/privacy}","received_events_url":"https://api.github.com/users/DamirSvrtan/received_events","type":"User","site_admin":false},"created_at":"2018-11-28T21:21:53Z","updated_at":"2018-11-28T21:21:53Z","author_association":"NONE","body":"Hi! \r\n\r\nI know that concurrency is not parallelism, but I believe this needs better wording because it sounds misleading.  I would not say they are executed concurrently, they might be executed in isolation (I guess one can error, the other won't), but they are executed **sequentially**, one after the other, am I right?\r\n\r\nIf I am, I would avoid the word **concurrent** in the docs."}}
{"actor":{"display_login":"DamirSvrtan"}}