Skip to content

Implement pluggable storage #478

@DuncanHills

Description

@DuncanHills

Currently to implement a plugin, the BotPlugin class is extended and members registered with @botcmd. In turn, BotPlugin extends StorageMixin which is hard-coded to use shelve as its storage mechanism. This is very inconvenient for creating new storage implementations, as well as for testing — these dependencies should be parameterized and composed instead of inherited. This approach would allow me to easily drop in a Redis Collection as the storage mechanism, for instance, since it also supports a dict-like interface (MutableMapping). This would also easily support configurable storage backends based on a flag passed to the application.

Really any dependencies should use this method but storage is the most obvious candidate right now.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions