void f_pagelet_server_flush() { ExecutionContext *context = g_context.getNoCheck(); Transport *transport = context->getTransport(); if (transport && transport->getThreadType() == Transport::PageletThread) { // this method is only meaningful in a pagelet thread context->obFlushAll(); String content = context->obDetachContents(); string s(content.data(), content.size()); if (!s.empty()) { PageletServer::AddToPipeline(s); } } }
int64_t HHVM_FUNCTION(hphp_thread_type) { Transport *transport = g_context->getTransport(); return transport ? static_cast<int64_t>(transport->getThreadType()) : -1; }