创建
This commit is contained in:
39
cache/include/cache_evbase_client.h
vendored
Normal file
39
cache/include/cache_evbase_client.h
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
#ifndef __CACHE_ASYN_CLIENT_H__
|
||||
#define __CACHE_ASYN_CLIENT_H__
|
||||
|
||||
#include <event2/event.h>
|
||||
#include <event.h>
|
||||
|
||||
#include "tango_cache_client.h"
|
||||
|
||||
struct cache_evbase_instance
|
||||
{
|
||||
struct tango_cache_instance *instance;
|
||||
evutil_socket_t notify_readfd;
|
||||
evutil_socket_t notify_sendfd;
|
||||
struct event_base* evbase;
|
||||
};
|
||||
|
||||
struct cache_evbase_ctx
|
||||
{
|
||||
struct tango_cache_ctx *ctx;
|
||||
struct cache_evbase_instance *instance_asyn;
|
||||
};
|
||||
|
||||
enum CACHE_ERR_CODE cache_evbase_get_last_error(const struct cache_evbase_ctx *ctx_asyn);
|
||||
enum CACHE_ERR_CODE cache_evbase_ctx_error(const struct cache_evbase_instance *instance);
|
||||
void cache_evbase_get_statistics(const struct cache_evbase_instance *instance, struct cache_statistics *out);
|
||||
|
||||
struct cache_evbase_instance *cache_evbase_instance_new(const char* profile_path, const char* section, void *runtimelog);
|
||||
|
||||
struct cache_evbase_ctx *cache_evbase_update_start(struct cache_evbase_instance *instance, struct future* future, struct tango_cache_meta *meta);
|
||||
int cache_evbase_update_frag(struct cache_evbase_ctx *ctx_asyn, enum PUT_MEMORY_COPY_WAY way, const char *data, size_t size);
|
||||
void cache_evbase_update_end(struct cache_evbase_ctx *ctx_asyn);
|
||||
const char *cache_evbase_get_object_key(struct cache_evbase_ctx *ctx_asyn);
|
||||
|
||||
int cache_evbase_upload_once(struct cache_evbase_instance *instance, struct future* future, enum PUT_MEMORY_COPY_WAY way, const char *data, size_t size, struct tango_cache_meta *meta, char *filename, size_t namelen);
|
||||
|
||||
int cache_evbase_fetch(struct cache_evbase_instance *instance, struct future* future, struct tango_cache_meta *meta);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user