Nebula
Loading...
Searching...
No Matches
httpclientregistry.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
15#include "core/refcounted.h"
16#include "core/singleton.h"
17#include "http/httpclient.h"
18#include "io/uri.h"
19#include "util/dictionary.h"
20#include "util/stringatom.h"
21
22//------------------------------------------------------------------------------
23namespace Http
24{
61
62//------------------------------------------------------------------------------
65inline bool
67{
68 return this->isValid;
69}
70
71} // namespace Http
72//------------------------------------------------------------------------------
The common base class of Nebula.
Definition refcounted.h:38
The HttpClientRegistry provides a way to re-use existing connections to HTTP servers instead of setti...
Definition httpclientregistry.h:26
HttpClientRegistry()
constructor
Definition httpclientregistry.cc:20
void ReleaseConnection(const IO::URI &uri)
give up connection to a HTTP server, this will NEVER disconnect!
Definition httpclientregistry.cc:127
Ptr< HttpClient > ObtainConnection(const IO::URI &uri)
open a connection to a HTTP server, reuse connection if already connected
Definition httpclientregistry.cc:94
bool IsValid() const
return true if the object has been setup
Definition httpclientregistry.h:66
bool isValid
Definition httpclientregistry.h:59
__DeclareSingleton(HttpClientRegistry)
virtual ~HttpClientRegistry()
destructor
Definition httpclientregistry.cc:29
Util::Dictionary< Util::StringAtom, Connection > connections
Definition httpclientregistry.h:58
bool IsConnected(const IO::URI &uri) const
check if a connection to an HTTP server exists
Definition httpclientregistry.cc:143
void DisconnectIdle()
disconnect all connections with a zero use count
Definition httpclientregistry.cc:72
void Setup()
setup the client registry
Definition httpclientregistry.cc:42
__DeclareClass(HttpClientRegistry)
void Discard()
discard the client registry, closes all open connections
Definition httpclientregistry.cc:52
An URI object can split a Uniform Resource Identifier string into its components or build a string fr...
Definition uri.h:67
Nebula's smart pointer class which manages the life time of RefCounted objects.
Definition ptr.h:38
A collection of key/value pairs with quick value retrieval by key at roughly O(log n).
Definition dictionary.h:34
This file was generated with Nebula Trifid's idlc compiler tool.
Definition defaulthttprequesthandler.cc:15
Definition httpclientregistry.h:53
Ptr< HttpClient > httpClient
Definition httpclientregistry.h:54
SizeT useCount
Definition httpclientregistry.h:55
int SizeT
Definition types.h:49