Page MenuHomePhabricator

Load handles just-in-time
Closed, ResolvedPublic

Description

Controllers have loadHandles() and loadViewerHandles(), neither of which work quite right:

  • loadViewerHandles() has a convenient signature but causes more loads than necessary;
  • loadHandles() has good data fetching semantics but an inconvenient signature.

They are also both bound to Controllers, which is an awkward place to coordinate handle loads.

Instead, we can provide a:

$handles = $viewer->loadHandles($phids);

...which returns an ArrayAccess / Iterator object that doesn't actually load the handles. When something accesses the handles, we can actually do the fetch.

This should improve caching and batching while providing desirable semantics, and improve coordination by letting callers coordinate on the Viewer (which is always available and reasonably the correct object to perform this coordination with) instead of the Controller.

Related Objects

StatusAssignedTask
Resolvedchad
ResolvedNone
Resolvedepriestley
DuplicateNone
ResolvedNone
Wontfixepriestley
Resolvedepriestley
Openepriestley
Resolvedepriestley
ResolvedNone
ResolvedNone
DuplicateNone
Wontfixepriestley
DuplicateNone
Resolvedepriestley
OpenNone
Wontfixepriestley
Resolvedepriestley
Resolvedchad
Resolvedepriestley
Wontfixepriestley
OpenNone
OpenNone
Resolvedepriestley
Resolvedepriestley
Resolvedepriestley
Resolvedepriestley
Resolvedepriestley

Event Timeline

epriestley claimed this task.
epriestley raised the priority of this task from to Normal.
epriestley updated the task description. (Show Details)
epriestley added a project: Typeahead.
epriestley added a subscriber: epriestley.
epriestley added a revision: Restricted Differential Revision.Mar 31 2015, 8:29 PM
epriestley added a commit: Restricted Diffusion Commit.Apr 2 2015, 1:30 PM