2005-03-13 20:39:32 +00:00
|
|
|
#include <lladd/transactional.h>
|
|
|
|
|
|
|
|
#ifndef __CONSUMER_H
|
2005-03-15 05:30:57 +00:00
|
|
|
#define __CONSUMER_H
|
2005-03-13 20:39:32 +00:00
|
|
|
|
2005-03-14 20:54:06 +00:00
|
|
|
#define MAX_ITERATOR_TYPES 10
|
|
|
|
#define FIFO_CONSUMER 0
|
|
|
|
#define ARRAY_CONSUMER 1
|
|
|
|
#define LOG_MEMORY_CONSUMER 2
|
2005-03-13 20:39:32 +00:00
|
|
|
|
|
|
|
typedef struct {
|
2005-03-14 00:25:29 +00:00
|
|
|
int foo;
|
2005-03-13 20:39:32 +00:00
|
|
|
} lladdConsumer_def_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
int type;
|
|
|
|
void * impl;
|
|
|
|
} lladdConsumer_t;
|
|
|
|
|
|
|
|
/* call once per Tinit() call */
|
|
|
|
void consumer_init();
|
|
|
|
|
2005-03-14 00:25:29 +00:00
|
|
|
void Tconsumer_close(int xid, lladdConsumer_t * it);
|
2005-03-13 20:39:32 +00:00
|
|
|
/**
|
|
|
|
|
2005-03-14 20:54:06 +00:00
|
|
|
@param xid Transaction id @param it The consumer
|
2005-03-13 20:39:32 +00:00
|
|
|
@param key Can be null if there is no key.
|
|
|
|
@param value Can be null if there is no value, but both can't be null. (Or can they???)
|
|
|
|
|
|
|
|
@return Error. Blocks when full.
|
|
|
|
|
|
|
|
*/
|
|
|
|
int Tconsumer_push(int xid, lladdConsumer_t * it, byte * key, size_t keySize, byte * val, size_t valSize);
|
|
|
|
|
|
|
|
/* @see Tconsumer_push
|
|
|
|
@return Error, or 'consumer full'
|
|
|
|
*/
|
2005-03-14 00:25:29 +00:00
|
|
|
//int Tconsumer_tryPush(int xid, ....);
|
|
|
|
|
2005-03-14 20:54:06 +00:00
|
|
|
#endif // __CONSUMER_H
|