created: 1245140688|%e %B %Y, %H:%M
Have started to reconstruct the engine API, it's looking nicer. The methods for handling stores and queues now look like this (commit 8c3f97b):
- store_ref = xump_store_create (engine, store_type, store_name);
- store_ref = xump_store_fetch (engine, store_name);
- xump_store_delete (engine, store_name);
- queue_ref = xump_queue_create (engine, store_name, queue_name);
- queue_ref = xump_queue_fetch (engine, queue_name);
- xump_queue_delete (engine, queue_name);
So that the queue refers to its store by name, rather than by reference.
For the store portals, I've used the factory feature of IPR portals, which lets us create store instances more simply. At startup we create a factory (also a portal) for each store implementation:
// Create new engine instance
engine = xump_new ();
// Create portal factory for each store implementation
store = xump_store_ram__xump_store_factory ("RAM");
xump__xump_store_bind (engine, store);
xump_store_unlink (&store);
We can then create new store instances by using the factory name as a 'store type', e.g:
store = xump_store_create (engine, "RAM", "store-1");
The actual work of finding the right factory and getting it to create a new store instance is done in the xump_store_create method.
Rate this post:
