{"action":"created","comment":{"url":"https://api.github.com/repos/named-data/ndn-js/pulls/comments/241241258","pull_request_review_id":184464596,"id":241241258,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MTI0MTI1OA==","diff_hunk":"@@ -20,117 +20,14 @@\n \n /** @ignore */\n var Interest = require('../interest.js').Interest; /** @ignore */\n-var Blob = require('./blob.js').Blob; /** @ignore */\n var KeyChain = require('../security/key-chain.js').KeyChain; /** @ignore */\n var NdnCommon = require('./ndn-common.js').NdnCommon;\n+var PipelineFixed = require('./pipeline-fixed.js').PipelineFixed;\n \n-/**\n- * SegmentFetcher is a utility class to fetch the latest version of segmented data.\n- *\n- * SegmentFetcher assumes that the data is named /<prefix>/<version>/<segment>,\n- * where:\n- * - <prefix> is the specified name prefix,\n- * - <version> is an unknown version that needs to be discovered, and\n- * - <segment> is a segment number. (The number of segments is unknown and is\n- *   controlled by the `FinalBlockId` field in at least the last Data packet.\n- *\n- * The following logic is implemented in SegmentFetcher:\n- *\n- * 1. Express the first Interest to discover the version:\n- *\n- *    >> Interest: /<prefix>?ChildSelector=1&MustBeFresh=true\n- *\n- * 2. Infer the latest version of the Data: <version> = Data.getName().get(-2)\n- *\n- * 3. If the segment number in the retrieved packet == 0, go to step 5.\n- *\n- * 4. Send an Interest for segment 0:\n- *\n- *    >> Interest: /<prefix>/<version>/<segment=0>\n- *\n- * 5. Keep sending Interests for the next segment while the retrieved Data does\n- *    not have a FinalBlockId or the FinalBlockId != Data.getName().get(-1).\n- *\n- *    >> Interest: /<prefix>/<version>/<segment=(N+1))>\n- *\n- * 6. Call the onComplete callback with a Blob that concatenates the content\n- *    from all the segmented objects.\n- *\n- * If an error occurs during the fetching process, the onError callback is called\n- * with a proper error code.  The following errors are possible:\n- *\n- * - `INTEREST_TIMEOUT`: if any of the Interests times out\n- * - `DATA_HAS_NO_SEGMENT`: if any of the retrieved Data packets don't have a segment\n- *   as the last component of the name (not counting the implicit digest)\n- * - `SEGMENT_VERIFICATION_FAILED`: if any retrieved segment fails\n- *   the user-provided VerifySegment callback or KeyChain verifyData.\n- * - `IO_ERROR`: for I/O errors when sending an Interest.\n- *\n- * In order to validate individual segments, a KeyChain needs to be supplied.\n- * If verifyData fails, the fetching process is aborted with\n- * SEGMENT_VERIFICATION_FAILED. If data validation is not required, pass null.\n- *\n- * Example:\n- *     var onComplete = function(content) { ... }\n- *\n- *     var onError = function(errorCode, message) { ... }\n- *\n- *     var interest = new Interest(new Name(\"/data/prefix\"));\n- *     interest.setInterestLifetimeMilliseconds(1000);\n- *\n- *     SegmentFetcher.fetch(face, interest, null, onComplete, onError);\n- *\n- * This is a private constructor to create a new SegmentFetcher to use the Face.\n- * An application should use SegmentFetcher.fetch. If validatorKeyChain is not\n- * null, use it and ignore verifySegment. After creating the SegmentFetcher,\n- * call fetchFirstSegment.\n- * @param {Face} face This calls face.expressInterest to fetch more segments.\n- * @param validatorKeyChain {KeyChain} If this is not null, use its verifyData\n- * instead of the verifySegment callback.\n- * @param {function} verifySegment When a Data packet is received this calls\n- * verifySegment(data) where data is a Data object. If it returns False then\n- * abort fetching and call onError with\n- * SegmentFetcher.ErrorCode.SEGMENT_VERIFICATION_FAILED.\n- * NOTE: The library will log any exceptions thrown by this callback, but for\n- * better error handling the callback should catch and properly handle any\n- * exceptions.\n- * @param {function} onComplete When all segments are received, call\n- * onComplete(content) where content is a Blob which has the concatenation of\n- * the content of all the segments.\n- * NOTE: The library will log any exceptions thrown by this callback, but for\n- * better error handling the callback should catch and properly handle any\n- * exceptions.\n- * @param {function} onError Call onError.onError(errorCode, message) for\n- * timeout or an error processing segments. errorCode is a value from\n- * SegmentFetcher.ErrorCode and message is a related string.\n- * NOTE: The library will log any exceptions thrown by this callback, but for\n- * better error handling the callback should catch and properly handle any\n- * exceptions.\n- * @constructor\n- */\n-var SegmentFetcher = function SegmentFetcher\n-  (face, validatorKeyChain, verifySegment, onComplete, onError)\n-{\n-  this.face = face;\n-  this.validatorKeyChain = validatorKeyChain;\n-  this.verifySegment = verifySegment;\n-  this.onComplete = onComplete;\n-  this.onError = onError;\n-\n-  this.contentParts = []; // of Buffer\n-};\n+var SegmentFetcher = function SegmentFetcher() { };\n \n exports.SegmentFetcher = SegmentFetcher;\n \n-/**\n- * An ErrorCode value is passed in the onError callback.\n- */\n-SegmentFetcher.ErrorCode = {","path":"js/util/segment-fetcher.js","position":111,"original_position":111,"commit_id":"3d7e85c4a28526f5b47abda7b980da96d5de9082","original_commit_id":"3d7e85c4a28526f5b47abda7b980da96d5de9082","user":{"login":"yoursunny","id":1141273,"node_id":"MDQ6VXNlcjExNDEyNzM=","avatar_url":"https://avatars2.githubusercontent.com/u/1141273?v=4","gravatar_id":"","url":"https://api.github.com/users/yoursunny","html_url":"https://github.com/yoursunny","followers_url":"https://api.github.com/users/yoursunny/followers","following_url":"https://api.github.com/users/yoursunny/following{/other_user}","gists_url":"https://api.github.com/users/yoursunny/gists{/gist_id}","starred_url":"https://api.github.com/users/yoursunny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yoursunny/subscriptions","organizations_url":"https://api.github.com/users/yoursunny/orgs","repos_url":"https://api.github.com/users/yoursunny/repos","events_url":"https://api.github.com/users/yoursunny/events{/privacy}","received_events_url":"https://api.github.com/users/yoursunny/received_events","type":"User","site_admin":false},"body":"SegmentFetcher.ErrorCode is public API (referenced by SegmentFetcher.fetch jsdoc). It must be preserved.","created_at":"2018-12-13T01:02:58Z","updated_at":"2018-12-13T01:05:20Z","html_url":"https://github.com/named-data/ndn-js/pull/70#discussion_r241241258","pull_request_url":"https://api.github.com/repos/named-data/ndn-js/pulls/70","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/named-data/ndn-js/pulls/comments/241241258"},"html":{"href":"https://github.com/named-data/ndn-js/pull/70#discussion_r241241258"},"pull_request":{"href":"https://api.github.com/repos/named-data/ndn-js/pulls/70"}}},"pull_request":{"url":"https://api.github.com/repos/named-data/ndn-js/pulls/70","id":238220650,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM4MjIwNjUw","html_url":"https://github.com/named-data/ndn-js/pull/70","diff_url":"https://github.com/named-data/ndn-js/pull/70.diff","patch_url":"https://github.com/named-data/ndn-js/pull/70.patch","issue_url":"https://api.github.com/repos/named-data/ndn-js/issues/70","number":70,"state":"open","locked":false,"title":"util: add PipelineFixed & DataFetcher classes","user":{"login":"chavoosh","id":7352881,"node_id":"MDQ6VXNlcjczNTI4ODE=","avatar_url":"https://avatars3.githubusercontent.com/u/7352881?v=4","gravatar_id":"","url":"https://api.github.com/users/chavoosh","html_url":"https://github.com/chavoosh","followers_url":"https://api.github.com/users/chavoosh/followers","following_url":"https://api.github.com/users/chavoosh/following{/other_user}","gists_url":"https://api.github.com/users/chavoosh/gists{/gist_id}","starred_url":"https://api.github.com/users/chavoosh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chavoosh/subscriptions","organizations_url":"https://api.github.com/users/chavoosh/orgs","repos_url":"https://api.github.com/users/chavoosh/repos","events_url":"https://api.github.com/users/chavoosh/events{/privacy}","received_events_url":"https://api.github.com/users/chavoosh/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-12-12T23:46:56Z","updated_at":"2018-12-13T01:05:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d15c476c0f806fe6cba0b0ac97c900c84ecf8f69","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/named-data/ndn-js/pulls/70/commits","review_comments_url":"https://api.github.com/repos/named-data/ndn-js/pulls/70/comments","review_comment_url":"https://api.github.com/repos/named-data/ndn-js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/named-data/ndn-js/issues/70/comments","statuses_url":"https://api.github.com/repos/named-data/ndn-js/statuses/3d7e85c4a28526f5b47abda7b980da96d5de9082","head":{"label":"chavoosh:master","ref":"master","sha":"3d7e85c4a28526f5b47abda7b980da96d5de9082","user":{"login":"chavoosh","id":7352881,"node_id":"MDQ6VXNlcjczNTI4ODE=","avatar_url":"https://avatars3.githubusercontent.com/u/7352881?v=4","gravatar_id":"","url":"https://api.github.com/users/chavoosh","html_url":"https://github.com/chavoosh","followers_url":"https://api.github.com/users/chavoosh/followers","following_url":"https://api.github.com/users/chavoosh/following{/other_user}","gists_url":"https://api.github.com/users/chavoosh/gists{/gist_id}","starred_url":"https://api.github.com/users/chavoosh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chavoosh/subscriptions","organizations_url":"https://api.github.com/users/chavoosh/orgs","repos_url":"https://api.github.com/users/chavoosh/repos","events_url":"https://api.github.com/users/chavoosh/events{/privacy}","received_events_url":"https://api.github.com/users/chavoosh/received_events","type":"User","site_admin":false},"repo":{"id":161558548,"node_id":"MDEwOlJlcG9zaXRvcnkxNjE1NTg1NDg=","name":"ndn-js","full_name":"chavoosh/ndn-js","private":false,"owner":{"login":"chavoosh","id":7352881,"node_id":"MDQ6VXNlcjczNTI4ODE=","avatar_url":"https://avatars3.githubusercontent.com/u/7352881?v=4","gravatar_id":"","url":"https://api.github.com/users/chavoosh","html_url":"https://github.com/chavoosh","followers_url":"https://api.github.com/users/chavoosh/followers","following_url":"https://api.github.com/users/chavoosh/following{/other_user}","gists_url":"https://api.github.com/users/chavoosh/gists{/gist_id}","starred_url":"https://api.github.com/users/chavoosh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chavoosh/subscriptions","organizations_url":"https://api.github.com/users/chavoosh/orgs","repos_url":"https://api.github.com/users/chavoosh/repos","events_url":"https://api.github.com/users/chavoosh/events{/privacy}","received_events_url":"https://api.github.com/users/chavoosh/received_events","type":"User","site_admin":false},"html_url":"https://github.com/chavoosh/ndn-js","description":"Lightweight NDN stack in pure javascript","fork":true,"url":"https://api.github.com/repos/chavoosh/ndn-js","forks_url":"https://api.github.com/repos/chavoosh/ndn-js/forks","keys_url":"https://api.github.com/repos/chavoosh/ndn-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chavoosh/ndn-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chavoosh/ndn-js/teams","hooks_url":"https://api.github.com/repos/chavoosh/ndn-js/hooks","issue_events_url":"https://api.github.com/repos/chavoosh/ndn-js/issues/events{/number}","events_url":"https://api.github.com/repos/chavoosh/ndn-js/events","assignees_url":"https://api.github.com/repos/chavoosh/ndn-js/assignees{/user}","branches_url":"https://api.github.com/repos/chavoosh/ndn-js/branches{/branch}","tags_url":"https://api.github.com/repos/chavoosh/ndn-js/tags","blobs_url":"https://api.github.com/repos/chavoosh/ndn-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chavoosh/ndn-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chavoosh/ndn-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/chavoosh/ndn-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chavoosh/ndn-js/statuses/{sha}","languages_url":"https://api.github.com/repos/chavoosh/ndn-js/languages","stargazers_url":"https://api.github.com/repos/chavoosh/ndn-js/stargazers","contributors_url":"https://api.github.com/repos/chavoosh/ndn-js/contributors","subscribers_url":"https://api.github.com/repos/chavoosh/ndn-js/subscribers","subscription_url":"https://api.github.com/repos/chavoosh/ndn-js/subscription","commits_url":"https://api.github.com/repos/chavoosh/ndn-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/chavoosh/ndn-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/chavoosh/ndn-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/chavoosh/ndn-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/chavoosh/ndn-js/contents/{+path}","compare_url":"https://api.github.com/repos/chavoosh/ndn-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chavoosh/ndn-js/merges","archive_url":"https://api.github.com/repos/chavoosh/ndn-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chavoosh/ndn-js/downloads","issues_url":"https://api.github.com/repos/chavoosh/ndn-js/issues{/number}","pulls_url":"https://api.github.com/repos/chavoosh/ndn-js/pulls{/number}","milestones_url":"https://api.github.com/repos/chavoosh/ndn-js/milestones{/number}","notifications_url":"https://api.github.com/repos/chavoosh/ndn-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chavoosh/ndn-js/labels{/name}","releases_url":"https://api.github.com/repos/chavoosh/ndn-js/releases{/id}","deployments_url":"https://api.github.com/repos/chavoosh/ndn-js/deployments","created_at":"2018-12-12T23:40:15Z","updated_at":"2018-12-12T23:45:41Z","pushed_at":"2018-12-12T23:45:40Z","git_url":"git://github.com/chavoosh/ndn-js.git","ssh_url":"git@github.com:chavoosh/ndn-js.git","clone_url":"https://github.com/chavoosh/ndn-js.git","svn_url":"https://github.com/chavoosh/ndn-js","homepage":"","size":28327,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"named-data:master","ref":"master","sha":"1ecd33f9e13e7c914a1bb771f2c0252fc8c3235d","user":{"login":"named-data","id":3679349,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2NzkzNDk=","avatar_url":"https://avatars1.githubusercontent.com/u/3679349?v=4","gravatar_id":"","url":"https://api.github.com/users/named-data","html_url":"https://github.com/named-data","followers_url":"https://api.github.com/users/named-data/followers","following_url":"https://api.github.com/users/named-data/following{/other_user}","gists_url":"https://api.github.com/users/named-data/gists{/gist_id}","starred_url":"https://api.github.com/users/named-data/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/named-data/subscriptions","organizations_url":"https://api.github.com/users/named-data/orgs","repos_url":"https://api.github.com/users/named-data/repos","events_url":"https://api.github.com/users/named-data/events{/privacy}","received_events_url":"https://api.github.com/users/named-data/received_events","type":"Organization","site_admin":false},"repo":{"id":3440997,"node_id":"MDEwOlJlcG9zaXRvcnkzNDQwOTk3","name":"ndn-js","full_name":"named-data/ndn-js","private":false,"owner":{"login":"named-data","id":3679349,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2NzkzNDk=","avatar_url":"https://avatars1.githubusercontent.com/u/3679349?v=4","gravatar_id":"","url":"https://api.github.com/users/named-data","html_url":"https://github.com/named-data","followers_url":"https://api.github.com/users/named-data/followers","following_url":"https://api.github.com/users/named-data/following{/other_user}","gists_url":"https://api.github.com/users/named-data/gists{/gist_id}","starred_url":"https://api.github.com/users/named-data/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/named-data/subscriptions","organizations_url":"https://api.github.com/users/named-data/orgs","repos_url":"https://api.github.com/users/named-data/repos","events_url":"https://api.github.com/users/named-data/events{/privacy}","received_events_url":"https://api.github.com/users/named-data/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/named-data/ndn-js","description":"Lightweight NDN stack in pure javascript","fork":false,"url":"https://api.github.com/repos/named-data/ndn-js","forks_url":"https://api.github.com/repos/named-data/ndn-js/forks","keys_url":"https://api.github.com/repos/named-data/ndn-js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/named-data/ndn-js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/named-data/ndn-js/teams","hooks_url":"https://api.github.com/repos/named-data/ndn-js/hooks","issue_events_url":"https://api.github.com/repos/named-data/ndn-js/issues/events{/number}","events_url":"https://api.github.com/repos/named-data/ndn-js/events","assignees_url":"https://api.github.com/repos/named-data/ndn-js/assignees{/user}","branches_url":"https://api.github.com/repos/named-data/ndn-js/branches{/branch}","tags_url":"https://api.github.com/repos/named-data/ndn-js/tags","blobs_url":"https://api.github.com/repos/named-data/ndn-js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/named-data/ndn-js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/named-data/ndn-js/git/refs{/sha}","trees_url":"https://api.github.com/repos/named-data/ndn-js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/named-data/ndn-js/statuses/{sha}","languages_url":"https://api.github.com/repos/named-data/ndn-js/languages","stargazers_url":"https://api.github.com/repos/named-data/ndn-js/stargazers","contributors_url":"https://api.github.com/repos/named-data/ndn-js/contributors","subscribers_url":"https://api.github.com/repos/named-data/ndn-js/subscribers","subscription_url":"https://api.github.com/repos/named-data/ndn-js/subscription","commits_url":"https://api.github.com/repos/named-data/ndn-js/commits{/sha}","git_commits_url":"https://api.github.com/repos/named-data/ndn-js/git/commits{/sha}","comments_url":"https://api.github.com/repos/named-data/ndn-js/comments{/number}","issue_comment_url":"https://api.github.com/repos/named-data/ndn-js/issues/comments{/number}","contents_url":"https://api.github.com/repos/named-data/ndn-js/contents/{+path}","compare_url":"https://api.github.com/repos/named-data/ndn-js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/named-data/ndn-js/merges","archive_url":"https://api.github.com/repos/named-data/ndn-js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/named-data/ndn-js/downloads","issues_url":"https://api.github.com/repos/named-data/ndn-js/issues{/number}","pulls_url":"https://api.github.com/repos/named-data/ndn-js/pulls{/number}","milestones_url":"https://api.github.com/repos/named-data/ndn-js/milestones{/number}","notifications_url":"https://api.github.com/repos/named-data/ndn-js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/named-data/ndn-js/labels{/name}","releases_url":"https://api.github.com/repos/named-data/ndn-js/releases{/id}","deployments_url":"https://api.github.com/repos/named-data/ndn-js/deployments","created_at":"2012-02-14T15:26:33Z","updated_at":"2018-11-30T12:14:12Z","pushed_at":"2018-12-12T23:46:56Z","git_url":"git://github.com/named-data/ndn-js.git","ssh_url":"git@github.com:named-data/ndn-js.git","clone_url":"https://github.com/named-data/ndn-js.git","svn_url":"https://github.com/named-data/ndn-js","homepage":"","size":28252,"stargazers_count":81,"watchers_count":81,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":27,"mirror_url":null,"archived":false,"open_issues_count":9,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":27,"open_issues":9,"watchers":81,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/named-data/ndn-js/pulls/70"},"html":{"href":"https://github.com/named-data/ndn-js/pull/70"},"issue":{"href":"https://api.github.com/repos/named-data/ndn-js/issues/70"},"comments":{"href":"https://api.github.com/repos/named-data/ndn-js/issues/70/comments"},"review_comments":{"href":"https://api.github.com/repos/named-data/ndn-js/pulls/70/comments"},"review_comment":{"href":"https://api.github.com/repos/named-data/ndn-js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/named-data/ndn-js/pulls/70/commits"},"statuses":{"href":"https://api.github.com/repos/named-data/ndn-js/statuses/3d7e85c4a28526f5b47abda7b980da96d5de9082"}},"author_association":"NONE"}}
{"actor":{"display_login":"yoursunny"}}