Skip to content

Commit

Permalink
Evaluate IMDone.
Browse files Browse the repository at this point in the history
  • Loading branch information
flatheadmill committed Dec 5, 2015
1 parent e53fd48 commit 60d897a
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 19 deletions.
37 changes: 37 additions & 0 deletions .imdone/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"exclude": [
"^(node_modules|bower_components|\\.imdone|target|build|dist|logs)[\\/\\\\]?|\\.(git|svn|hg|npmignore)|\\~$|\\.(jpg|png|gif|swp|ttf|otf)$"
],
"watcher": true,
"code": {
"include_lists": [
"todo",
"TODO",
"DOING",
"DONE",
"PLANNING",
"FIXME",
"ARCHIVE",
"HACK",
"CHANGED",
"XXX",
"IDEA",
"NOTE",
"REVIEW"
]
},
"lists": [
{
"name": "TODO",
"hidden": false
}
],
"marked": {
"gfm": true,
"tables": true,
"breaks": false,
"pedantic": false,
"smartLists": true,
"langPrefix": "language-"
}
}
5 changes: 3 additions & 2 deletions balancer.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ Balancer.prototype.balance = cadence(function balance (async, sheaf) {
_gather.call(this, +address, lengths[address], async())
})(addresses)
}, function () {
// TODO permeate('bigeasy.strata.plan', {}, async())
this.sheaf.tracer('plan', {}, async())
}, function () {
var address, node, difference, addresses
Expand Down Expand Up @@ -460,7 +461,7 @@ Balancer.prototype.exorcise = function (pivot, page, corporal) {
ok(page.ghosts, 'no ghosts')
ok(corporal.items.length - corporal.ghosts > 0, 'no replacement')

// todo: how is this not a race condition? I'm writing to the log, but I've
// TODO how is this not a race condition? I'm writing to the log, but I've
// not updated the pivot page, not rewritten during `deleteGhosts`.
page.splice(0, 1, corporal.splice(corporal.ghosts, 1))
page.ghosts = 0
Expand Down Expand Up @@ -556,7 +557,7 @@ Balancer.prototype.mergePagesAndUnlock = cadence(function (
var merge = async([function () {
descents.forEach(function (descent) { locker.unlock(descent.page) })
! [ 'left', 'right' ].forEach(function (direction) {
// todo: use `pages` array, these conditions are tricky,
// TODO use `pages` array, these conditions are tricky,
// `parents[direction]` may not yet exist.
if (singles[direction].length) {
singles[direction].forEach(function (page) { locker.unlock(page) })
Expand Down
5 changes: 3 additions & 2 deletions cursor.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ function Cursor (sheaf, logger, descents, exclusive, searchKey) {
descents.shift()
}

// TODO get rid of comments like this one
// to user land
Cursor.prototype.next = cadence(function (async) {
var next
Expand Down Expand Up @@ -45,7 +46,7 @@ Cursor.prototype.indexOf = function (key, index) {
var page = this.page
var index = this.sheaf.find(page, key, index)
var unambiguous
unambiguous = -1 < index // <- todo: ?
unambiguous = -1 < index // <- TODO ?
|| ~ index < this.page.items.length
|| page.right.address === null
if (!unambiguous && this.sheaf.comparator(key, page.right.key) >= 0) {
Expand All @@ -63,7 +64,7 @@ Cursor.prototype._unlock = cadence(function (async) {
})
})

// todo: pass an integer as the first argument to force the arity of the
// TODO pass an integer as the first argument to force the arity of the
// return.
Cursor.prototype.unlock = function (callback) {
if (this._appender) {
Expand Down
6 changes: 3 additions & 3 deletions locker.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function Locker (sheaf, magazine) {
}

Locker.prototype.lock = cadence(function (async, address, exclusive) {
// todo: locks does not appear to need to be an array.
// TODO locks does not appear to need to be an array.
var cartridge = this._magazine.hold(address, {}),
page = cartridge.value.page, locks = []

Expand All @@ -28,7 +28,7 @@ Locker.prototype.lock = cadence(function (async, address, exclusive) {
// by the final external catch block.
async([function () {
async(function () {
// todo: does there need to be differnt types anymore?
// TODO does there need to be differnt types anymore?
page = this._sheaf.createPage(address % 2, address)
cartridge.value.page = page
page.cartridge = cartridge
Expand All @@ -54,7 +54,7 @@ Locker.prototype.lock = cadence(function (async, address, exclusive) {
}, function () {
return [ page ]
})
}) // todo: unecessary cadence
}) // TODO unecessary cadence
}, function (error) {
cartridge.release()
delete this._locks[page.address]
Expand Down
2 changes: 1 addition & 1 deletion logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var Scribe = require('./scribe')

function Logger (options) {
this._directory = options.directory
// todo: remove when page can slice
// TODO remove when page can slice
this._sheaf = options.sheaf
this.framer = options.framer
this.serializers = options.serializers
Expand Down
6 changes: 3 additions & 3 deletions player.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function Player (options) {
this.userRecordHandler = options.userRecordHandler
}

// todo: outgoing
// TODO outgoing
Player.prototype.io = cadence(function (async, direction, filename) {
async(function () {
fs.open(filename, direction[0], async())
Expand Down Expand Up @@ -84,7 +84,7 @@ Player.prototype._play = function (sheaf, slice, start, page) {
} else {
var index = header[1]
if (leaf) {
// todo: see if it is faster to perform the slices here directly.
// TODO see if it is faster to perform the slices here directly.
if (index > 0) {
page.splice(index - 1, 0, {
key: sheaf.extractor(entry.body),
Expand Down Expand Up @@ -115,7 +115,7 @@ Player.prototype._play = function (sheaf, slice, start, page) {

Player.prototype.play = cadence(function (async, sheaf, fd, stat, read, page) {
var buffer = new Buffer(sheaf.options.readLeafStartLength || 1024 * 1024)
// todo: really want to register a cleanup without an indent.
// TODO really want to register a cleanup without an indent.
async([function () {
fs.close(fd, async())
}], function () {
Expand Down
12 changes: 6 additions & 6 deletions strata.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var Cache = require('magazine'),
ok = require('assert').ok,
path = require('path')

// todo: temporary
// TODO temporary
var scram = require('./scram')

function extend(to, from) {
Expand Down Expand Up @@ -77,13 +77,13 @@ Strata.prototype.create = cadence(function (async) {
Strata.prototype.open = cadence(function (async) {
this.sheaf.createMagazine()

// todo: instead of rescue, you might try/catch the parts that you know
// TODO instead of rescue, you might try/catch the parts that you know
// are likely to cause errors and raise an error of a Strata type.

// todo: or you might need some way to catch a callback error. Maybe an
// TODO or you might need some way to catch a callback error. Maybe an
// outer most catch block?

// todo: or if you're using Cadence, doesn't the callback get wrapped
// TODO or if you're using Cadence, doesn't the callback get wrapped
// anyway?
async(function () {
fs.stat(this.sheaf.directory, async())
Expand All @@ -100,11 +100,11 @@ Strata.prototype.open = cadence(function (async) {

// to user land
Strata.prototype.close = cadence(function (async) {
// todo: that's a lot of indirection.
// TODO that's a lot of indirection.
var cartridge = this.sheaf.metaRoot.cartridge, lock = cartridge.value.page.lock

lock.unlock()
// todo
// TODO
lock.dispose()

cartridge.release()
Expand Down
4 changes: 2 additions & 2 deletions t/proof.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function vivify (directory, callback) {
}
}

// todo: pretty print should be in here, so I can use it from stratify and the
// TODO pretty print should be in here, so I can use it from stratify and the
// stringify utility.
function stringify (directory, callback) {
vivify(directory, check(callback, segments))
Expand All @@ -73,7 +73,7 @@ function load (segments, callback) {
}
}

// todo: do not accept async, make a real function.
// TODO do not accept async, make a real function.
function insert (async, strata, values) {
async(function () {
values.sort()
Expand Down

0 comments on commit 60d897a

Please sign in to comment.