{"action":"created","comment":{"url":"https://api.github.com/repos/BohemianCoding/BCFoundation/pulls/comments/90220901","pull_request_review_id":10741954,"id":90220901,"diff_hunk":"@@ -0,0 +1,50 @@\n+//  Created by Pieter Omvlee on 26/10/2016.\n+//  Copyright © 2016 Bohemian Coding. All rights reserved.\n+\n+#import \"NSArray+ConcurrentMap.h\"\n+\n+@interface BCConcurrentMapOperation : NSOperation\n+@property (nonatomic, strong) id object, result;\n+@property (nonatomic, copy) BCMapBlock mapBlock;\n+@end\n+\n+@implementation BCConcurrentMapOperation\n+- (void)main {\n+  id source = self.object;\n+  self.result = self.mapBlock(source);\n+}\n+@end\n+\n+@implementation NSArray (ConcurrentMap)\n+\n+- (void)concurrentMap:(BCMapBlock)block maxConcurrentCount:(NSInteger)maxConcurrentCount completionBlock:(BCConcurrentMapCompletionBlock)completionBlock {\n+  \n+  NSOperationQueue *queue = [NSOperationQueue new];\n+  if (maxConcurrentCount > 0)\n+    queue.maxConcurrentOperationCount = maxConcurrentCount;\n+  \n+  NSArray *operations = [self map:^id(id object) {\n+    BCConcurrentMapOperation *op = [BCConcurrentMapOperation new];\n+    op.object = object;\n+    op.mapBlock = block;\n+    return op;\n+  }];\n+  \n+  //the final operation maps from the operations to a result array;\n+  NSBlockOperation *finalOperation = [NSBlockOperation blockOperationWithBlock:^{\n+    NSArray *result = [operations map:^id(BCConcurrentMapOperation *op) {\n+      return op.result;\n+    }];\n+    completionBlock(result);\n+  }];\n+  \n+  //submit all operations and add the finalOperation as dependency to all\n+  //we can be sure that the concurrent operations are all finished and wil all have a result set by this time\n+  for (NSOperation *operation in operations) {\n+    [queue addOperation:operation];\n+    [finalOperation addDependency:operation];","path":"Source/NSArray+ConcurrentMap.m","position":45,"original_position":45,"commit_id":"5dd2f19bb360df1ee126a21cd42ba1404282d633","original_commit_id":"5dd2f19bb360df1ee126a21cd42ba1404282d633","user":{"login":"pieteromvlee","id":160783,"avatar_url":"https://avatars.githubusercontent.com/u/160783?v=3","gravatar_id":"","url":"https://api.github.com/users/pieteromvlee","html_url":"https://github.com/pieteromvlee","followers_url":"https://api.github.com/users/pieteromvlee/followers","following_url":"https://api.github.com/users/pieteromvlee/following{/other_user}","gists_url":"https://api.github.com/users/pieteromvlee/gists{/gist_id}","starred_url":"https://api.github.com/users/pieteromvlee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pieteromvlee/subscriptions","organizations_url":"https://api.github.com/users/pieteromvlee/orgs","repos_url":"https://api.github.com/users/pieteromvlee/repos","events_url":"https://api.github.com/users/pieteromvlee/events{/privacy}","received_events_url":"https://api.github.com/users/pieteromvlee/received_events","type":"User","site_admin":false},"body":"Our tile rendering operations rely heavily on Operation dependencies so if thats the case that might be a bigger problem...","created_at":"2016-11-30T12:13:23Z","updated_at":"2016-11-30T12:13:23Z","html_url":"https://github.com/BohemianCoding/BCFoundation/pull/90#discussion_r90220901","pull_request_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/pulls/90","_links":{"self":{"href":"https://api.github.com/repos/BohemianCoding/BCFoundation/pulls/comments/90220901"},"html":{"href":"https://github.com/BohemianCoding/BCFoundation/pull/90#discussion_r90220901"},"pull_request":{"href":"https://api.github.com/repos/BohemianCoding/BCFoundation/pulls/90"}}},"pull_request":{"url":"https://api.github.com/repos/BohemianCoding/BCFoundation/pulls/90","id":90992821,"html_url":"https://github.com/BohemianCoding/BCFoundation/pull/90","diff_url":"https://github.com/BohemianCoding/BCFoundation/pull/90.diff","patch_url":"https://github.com/BohemianCoding/BCFoundation/pull/90.patch","issue_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/issues/90","number":90,"state":"open","locked":false,"title":"Feature/10486","user":{"login":"pieteromvlee","id":160783,"avatar_url":"https://avatars.githubusercontent.com/u/160783?v=3","gravatar_id":"","url":"https://api.github.com/users/pieteromvlee","html_url":"https://github.com/pieteromvlee","followers_url":"https://api.github.com/users/pieteromvlee/followers","following_url":"https://api.github.com/users/pieteromvlee/following{/other_user}","gists_url":"https://api.github.com/users/pieteromvlee/gists{/gist_id}","starred_url":"https://api.github.com/users/pieteromvlee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pieteromvlee/subscriptions","organizations_url":"https://api.github.com/users/pieteromvlee/orgs","repos_url":"https://api.github.com/users/pieteromvlee/repos","events_url":"https://api.github.com/users/pieteromvlee/events{/privacy}","received_events_url":"https://api.github.com/users/pieteromvlee/received_events","type":"User","site_admin":false},"body":"Connect to https://github.com/BohemianCoding/Sketch/issues/10486\n","created_at":"2016-10-26T12:20:30Z","updated_at":"2016-11-30T12:13:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"77d5fee0030d1f5024eb2a29516a44a6765f21f9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/pulls/90/commits","review_comments_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/pulls/90/comments","review_comment_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/pulls/comments{/number}","comments_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/issues/90/comments","statuses_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/statuses/5dd2f19bb360df1ee126a21cd42ba1404282d633","head":{"label":"BohemianCoding:feature/10486","ref":"feature/10486","sha":"5dd2f19bb360df1ee126a21cd42ba1404282d633","user":{"login":"BohemianCoding","id":4498264,"avatar_url":"https://avatars.githubusercontent.com/u/4498264?v=3","gravatar_id":"","url":"https://api.github.com/users/BohemianCoding","html_url":"https://github.com/BohemianCoding","followers_url":"https://api.github.com/users/BohemianCoding/followers","following_url":"https://api.github.com/users/BohemianCoding/following{/other_user}","gists_url":"https://api.github.com/users/BohemianCoding/gists{/gist_id}","starred_url":"https://api.github.com/users/BohemianCoding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BohemianCoding/subscriptions","organizations_url":"https://api.github.com/users/BohemianCoding/orgs","repos_url":"https://api.github.com/users/BohemianCoding/repos","events_url":"https://api.github.com/users/BohemianCoding/events{/privacy}","received_events_url":"https://api.github.com/users/BohemianCoding/received_events","type":"Organization","site_admin":false},"repo":{"id":13962123,"name":"BCFoundation","full_name":"BohemianCoding/BCFoundation","owner":{"login":"BohemianCoding","id":4498264,"avatar_url":"https://avatars.githubusercontent.com/u/4498264?v=3","gravatar_id":"","url":"https://api.github.com/users/BohemianCoding","html_url":"https://github.com/BohemianCoding","followers_url":"https://api.github.com/users/BohemianCoding/followers","following_url":"https://api.github.com/users/BohemianCoding/following{/other_user}","gists_url":"https://api.github.com/users/BohemianCoding/gists{/gist_id}","starred_url":"https://api.github.com/users/BohemianCoding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BohemianCoding/subscriptions","organizations_url":"https://api.github.com/users/BohemianCoding/orgs","repos_url":"https://api.github.com/users/BohemianCoding/repos","events_url":"https://api.github.com/users/BohemianCoding/events{/privacy}","received_events_url":"https://api.github.com/users/BohemianCoding/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BohemianCoding/BCFoundation","description":"Shared prefixes, configurations etc for a number of other projects","fork":false,"url":"https://api.github.com/repos/BohemianCoding/BCFoundation","forks_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/forks","keys_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/teams","hooks_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/hooks","issue_events_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/issues/events{/number}","events_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/events","assignees_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/assignees{/user}","branches_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/branches{/branch}","tags_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/tags","blobs_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/git/refs{/sha}","trees_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/statuses/{sha}","languages_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/languages","stargazers_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/stargazers","contributors_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/contributors","subscribers_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/subscribers","subscription_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/subscription","commits_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/commits{/sha}","git_commits_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/git/commits{/sha}","comments_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/comments{/number}","issue_comment_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/issues/comments{/number}","contents_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/contents/{+path}","compare_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/merges","archive_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/downloads","issues_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/issues{/number}","pulls_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/pulls{/number}","milestones_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/milestones{/number}","notifications_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/labels{/name}","releases_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/releases{/id}","deployments_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/deployments","created_at":"2013-10-29T16:48:27Z","updated_at":"2016-01-25T15:08:14Z","pushed_at":"2016-11-29T18:03:59Z","git_url":"git://github.com/BohemianCoding/BCFoundation.git","ssh_url":"git@github.com:BohemianCoding/BCFoundation.git","clone_url":"https://github.com/BohemianCoding/BCFoundation.git","svn_url":"https://github.com/BohemianCoding/BCFoundation","homepage":"","size":478,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":7,"forks":1,"open_issues":7,"watchers":0,"default_branch":"develop"}},"base":{"label":"BohemianCoding:develop","ref":"develop","sha":"547ec8779e8e85dd32fc6ff25946264b01f3550d","user":{"login":"BohemianCoding","id":4498264,"avatar_url":"https://avatars.githubusercontent.com/u/4498264?v=3","gravatar_id":"","url":"https://api.github.com/users/BohemianCoding","html_url":"https://github.com/BohemianCoding","followers_url":"https://api.github.com/users/BohemianCoding/followers","following_url":"https://api.github.com/users/BohemianCoding/following{/other_user}","gists_url":"https://api.github.com/users/BohemianCoding/gists{/gist_id}","starred_url":"https://api.github.com/users/BohemianCoding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BohemianCoding/subscriptions","organizations_url":"https://api.github.com/users/BohemianCoding/orgs","repos_url":"https://api.github.com/users/BohemianCoding/repos","events_url":"https://api.github.com/users/BohemianCoding/events{/privacy}","received_events_url":"https://api.github.com/users/BohemianCoding/received_events","type":"Organization","site_admin":false},"repo":{"id":13962123,"name":"BCFoundation","full_name":"BohemianCoding/BCFoundation","owner":{"login":"BohemianCoding","id":4498264,"avatar_url":"https://avatars.githubusercontent.com/u/4498264?v=3","gravatar_id":"","url":"https://api.github.com/users/BohemianCoding","html_url":"https://github.com/BohemianCoding","followers_url":"https://api.github.com/users/BohemianCoding/followers","following_url":"https://api.github.com/users/BohemianCoding/following{/other_user}","gists_url":"https://api.github.com/users/BohemianCoding/gists{/gist_id}","starred_url":"https://api.github.com/users/BohemianCoding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BohemianCoding/subscriptions","organizations_url":"https://api.github.com/users/BohemianCoding/orgs","repos_url":"https://api.github.com/users/BohemianCoding/repos","events_url":"https://api.github.com/users/BohemianCoding/events{/privacy}","received_events_url":"https://api.github.com/users/BohemianCoding/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/BohemianCoding/BCFoundation","description":"Shared prefixes, configurations etc for a number of other projects","fork":false,"url":"https://api.github.com/repos/BohemianCoding/BCFoundation","forks_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/forks","keys_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/teams","hooks_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/hooks","issue_events_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/issues/events{/number}","events_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/events","assignees_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/assignees{/user}","branches_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/branches{/branch}","tags_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/tags","blobs_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/git/refs{/sha}","trees_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/statuses/{sha}","languages_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/languages","stargazers_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/stargazers","contributors_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/contributors","subscribers_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/subscribers","subscription_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/subscription","commits_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/commits{/sha}","git_commits_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/git/commits{/sha}","comments_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/comments{/number}","issue_comment_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/issues/comments{/number}","contents_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/contents/{+path}","compare_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/merges","archive_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/downloads","issues_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/issues{/number}","pulls_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/pulls{/number}","milestones_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/milestones{/number}","notifications_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/labels{/name}","releases_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/releases{/id}","deployments_url":"https://api.github.com/repos/BohemianCoding/BCFoundation/deployments","created_at":"2013-10-29T16:48:27Z","updated_at":"2016-01-25T15:08:14Z","pushed_at":"2016-11-29T18:03:59Z","git_url":"git://github.com/BohemianCoding/BCFoundation.git","ssh_url":"git@github.com:BohemianCoding/BCFoundation.git","clone_url":"https://github.com/BohemianCoding/BCFoundation.git","svn_url":"https://github.com/BohemianCoding/BCFoundation","homepage":"","size":478,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":7,"forks":1,"open_issues":7,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/BohemianCoding/BCFoundation/pulls/90"},"html":{"href":"https://github.com/BohemianCoding/BCFoundation/pull/90"},"issue":{"href":"https://api.github.com/repos/BohemianCoding/BCFoundation/issues/90"},"comments":{"href":"https://api.github.com/repos/BohemianCoding/BCFoundation/issues/90/comments"},"review_comments":{"href":"https://api.github.com/repos/BohemianCoding/BCFoundation/pulls/90/comments"},"review_comment":{"href":"https://api.github.com/repos/BohemianCoding/BCFoundation/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/BohemianCoding/BCFoundation/pulls/90/commits"},"statuses":{"href":"https://api.github.com/repos/BohemianCoding/BCFoundation/statuses/5dd2f19bb360df1ee126a21cd42ba1404282d633"}}}}
{"actor":{"display_login":"pieteromvlee"}}