Skip to content
This repository has been archived by the owner on Apr 1, 2024. It is now read-only.

Refactor take 2 #139

Closed
wants to merge 5 commits into from
Closed

Refactor take 2 #139

wants to merge 5 commits into from

Conversation

fredemmott
Copy link
Contributor

  • all tests pass, including tests added that failed against previous PR
  • every element renders itself and it's children
  • all child rendering is async
  • so, the XHP tree becomes a corresponding async tree

This means that asyncRender() at different depths in the tree can be executing simultaneously.

There shouldn't be much of a performance cost, as HHVM should convert things things
to a StaticWaitHandle when XHPAsync isn't being used.

fixes #136
fixes #85

- all tests pass, including tests added that failed against previous PR
- every element renders itself and it's children
- all child rendering is async
- so, the XHP tree becomes a corresponding async tree

This means that asyncRender() at different depths in the tree can be executing simultaneously.

There shouldn't be much of a performance cost, as HHVM should convert things things
to a StaticWaitHandle when XHPAsync isn't being used.

fixes hhvm#136
fixes hhvm#85

$this->assertGreaterThan($max_start, $min_mid, 'all should be started before any get continued');
$this->assertGreaterThan($max_mid, $min_finish, 'all should have reached stage two before any finish');
$this->assertGreaterThan($max_start, $min_finish, 'sanity check: all have started before any finish');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually the only one that matches HHVM's guarantees - the others match as long as HHVM keeps on eagerly executing until it sees a native waithandle, which is likely (though not certain) to continue.

@fredemmott
Copy link
Contributor Author

ping

}
}
if ($awaitables) {
$awaited = await HH\Asio\m($awaitables);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's HH\Asio\m?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

genm

@Swahvay
Copy link
Contributor

Swahvay commented May 14, 2015

Well everything looks good to me. Excited to get this in and see if things of mine break from validation that was never being run before.

@fredemmott fredemmott deleted the refactor-take-2 branch March 4, 2020 21:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants