Skip to content

Instantly share code, notes, and snippets.

<?php
function myHttpHandler(Request $request, Response $response) {
// async function that returns a promise
// we use yield to wait for that promise to resolve then resume here
// if there's some kind of error it will be thrown into our generator
$session = yield loadSessionFromRequest($request);
if ($session->hasValue('isLoggedIn')) {
// pass the individual promises from generateHttpBody() through using `yield from`

Keybase proof

I hereby claim:

  • I am rdlowrey on github.
  • I am dlowrey (https://keybase.io/dlowrey) on keybase.
  • I have a public key whose fingerprint is BA24 A9CC 19EE 0EBA 2078 1F9F AEE1 B63D FC9D 0D88

To claim this, I am signing this object:

@rdlowrey
rdlowrey / keybase.md
Created April 12, 2018 13:21
keybase.md

Keybase proof

I hereby claim:

  • I am rdlowrey on github.
  • I am rdlowrey (https://keybase.io/rdlowrey) on keybase.
  • I have a public key ASBeQKDHmLVbYmkyKlQ5gtlC1y41gcvv-rSB4tYjNJBqago

To claim this, I am signing this object: