Skip to content

Commit

Permalink
feat: PHP grpc FaaS PoC
Browse files Browse the repository at this point in the history
Need to address memory leak: grpc/grpc#26085
  • Loading branch information
tjholm committed Jun 11, 2021
1 parent b2a9143 commit 8f3ee55
Show file tree
Hide file tree
Showing 159 changed files with 12,766 additions and 1,547 deletions.
1 change: 0 additions & 1 deletion .gitignore
@@ -1,5 +1,4 @@
/vendor/
.idea
/interfaces/
.phpunit.result.cache
.phpdoc
3 changes: 2 additions & 1 deletion composer.json
Expand Up @@ -7,7 +7,8 @@
"grpc/grpc": "^v1.30.0",
"ext-grpc": "*",
"ext-protobuf": "*",
"amphp/http-server": "^2.1"
"amphp/http-server": "^2.1",
"amphp/parallel": "^1.4"
},
"require-dev": {
"ext-xdebug": "*",
Expand Down
70 changes: 69 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

88 changes: 80 additions & 8 deletions docs/classes/Nitric-Api-AbstractClient.html
Expand Up @@ -15,6 +15,7 @@
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
<script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script src="js/search.js"></script>
Expand Down Expand Up @@ -110,7 +111,8 @@ <h2 class="phpdocumentor-content__title">
<abbr class="phpdocumentor-element-found-in__file" title="Nitric/Api/AbstractClient.php"><a href="files/nitric-api-abstractclient.html"><abbr title="Nitric/Api/AbstractClient.php">AbstractClient.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">64</span>
</aside>

</aside>

<p class="phpdocumentor-summary">Class AbstractClient, provides common client class functionality and configuration.</p>

Expand Down Expand Up @@ -200,7 +202,8 @@ <h4 class="phpdocumentor-element__name" id="constant_SERVICE_BIND">
<abbr class="phpdocumentor-element-found-in__file" title="Nitric/Api/AbstractClient.php"><a href="files/nitric-api-abstractclient.html"><abbr title="Nitric/Api/AbstractClient.php">AbstractClient.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">66</span>
</aside>

</aside>


<code class="phpdocumentor-signature phpdocumentor-code ">
Expand Down Expand Up @@ -243,7 +246,8 @@ <h4 class="phpdocumentor-element__name" id="property_hostname">
<abbr class="phpdocumentor-element-found-in__file" title="Nitric/Api/AbstractClient.php"><a href="files/nitric-api-abstractclient.html"><abbr title="Nitric/Api/AbstractClient.php">AbstractClient.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">67</span>
</aside>

</aside>


<code class="phpdocumentor-code phpdocumentor-signature ">
Expand Down Expand Up @@ -276,7 +280,8 @@ <h4 class="phpdocumentor-element__name" id="property_opts">
<abbr class="phpdocumentor-element-found-in__file" title="Nitric/Api/AbstractClient.php"><a href="files/nitric-api-abstractclient.html"><abbr title="Nitric/Api/AbstractClient.php">AbstractClient.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">68</span>
</aside>

</aside>


<code class="phpdocumentor-code phpdocumentor-signature ">
Expand Down Expand Up @@ -313,7 +318,8 @@ <h4 class="phpdocumentor-element__name" id="method___construct">
<abbr class="phpdocumentor-element-found-in__file" title="Nitric/Api/AbstractClient.php"><a href="files/nitric-api-abstractclient.html"><abbr title="Nitric/Api/AbstractClient.php">AbstractClient.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">70</span>
</aside>

</aside>


<code class="phpdocumentor-code phpdocumentor-signature ">
Expand Down Expand Up @@ -345,7 +351,8 @@ <h4 class="phpdocumentor-element__name" id="method_classFromStruct">
<abbr class="phpdocumentor-element-found-in__file" title="Nitric/Api/AbstractClient.php"><a href="files/nitric-api-abstractclient.html"><abbr title="Nitric/Api/AbstractClient.php">AbstractClient.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">90</span>
</aside>

</aside>


<code class="phpdocumentor-code phpdocumentor-signature ">
Expand Down Expand Up @@ -388,7 +395,8 @@ <h4 class="phpdocumentor-element__name" id="method_structFromClass">
<abbr class="phpdocumentor-element-found-in__file" title="Nitric/Api/AbstractClient.php"><a href="files/nitric-api-abstractclient.html"><abbr title="Nitric/Api/AbstractClient.php">AbstractClient.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">79</span>
</aside>

</aside>


<code class="phpdocumentor-code phpdocumentor-signature ">
Expand Down Expand Up @@ -431,7 +439,8 @@ <h4 class="phpdocumentor-element__name" id="method_okOrThrow">
<abbr class="phpdocumentor-element-found-in__file" title="Nitric/Api/AbstractClient.php"><a href="files/nitric-api-abstractclient.html"><abbr title="Nitric/Api/AbstractClient.php">AbstractClient.php</abbr></a></abbr>
:
<span class="phpdocumentor-element-found-in__line">108</span>
</aside>

</aside>

<p class="phpdocumentor-summary">Check the status returned from an autogenerate gRPC client call. If any status other than OK is detected, throw
the corresponding exception type.</p>
Expand Down Expand Up @@ -462,6 +471,68 @@ <h5 class="phpdocumentor-return-value__heading">Return values</h5>
</article>
</section>


<script type="text/javascript">
function loadExternalCodeSnippets(line) {
Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach((pre) => {
var src = pre.getAttribute('data-src').replace( /\\/g, '/');
var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
var language = 'php';

var code = document.createElement('code');
code.className = 'language-' + language;

pre.textContent = '';

pre.setAttribute('data-line', line)
code.textContent = 'Loading…';

pre.appendChild(code);

var xhr = new XMLHttpRequest();

xhr.open('GET', src, true);

xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {

if (xhr.status < 400 && xhr.responseText) {
code.textContent = xhr.responseText;

Prism.highlightElement(code);
}
else if (xhr.status >= 400) {
code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
}
else {
code.textContent = '✖ Error: File does not exist, is empty or trying to view from localhost';
}
}
};

xhr.send(null);
});
}

var modals = document.querySelectorAll("[data-modal]");

modals.forEach(function (trigger) {
trigger.addEventListener("click", function (event) {
//event.preventDefault();
const modal = document.getElementById(trigger.dataset.modal);
modal.classList.add("phpdocumentor-modal__open");
loadExternalCodeSnippets(trigger.dataset.line)
const exits = modal.querySelectorAll("[data-exit-button]");
exits.forEach(function (exit) {
exit.addEventListener("click", function (event) {
event.preventDefault();
modal.classList.remove("phpdocumentor-modal__open");
});
});
});
});
</script>

</article>
<section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
<section class="phpdocumentor-search-results__dialog">
Expand All @@ -486,5 +557,6 @@ <h2 class="phpdocumentor-search-results__title">Search results</h2>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
</body>
</html>

0 comments on commit 8f3ee55

Please sign in to comment.