#ifndef _MMC_H_
#define _MMC_H_
#include "hloop.h"
#include "kpacket.h"

// subscribe a event
// param will be keep, can trans to handler
uint32_t mmc_sub(uint16_t event, hevent_cb cb, hevent_priority_e priority);


/*async event
  packet 会被mmc引用计数+1,然后回调完所有后-1
  如果, packet在外部异步回调,请在外部增/减引用
*/
uint32_t mmc_pub(kpacket *packet);


//sync event, call directly, and return
//uint32_t mmc_pub_sync(kpacket *packet);


/* init mmc */
uint32_t mmc_init(uint32_t mmc_queue_size);

//deinit mmc
uint32_t mmc_deinit();

void mmc_test();


#endif /* _MMC_H_ */
