boto/botocore — pull request #419 by jamesls (2014-12-20 00:07:24+00:00)
Title: Event handlers should be per client

This PR includes two changes that need to go together:

1) Expose the ability to register events via a client interface.
2) Each client should have its own set of event handlers.

For (1) in order to avoid namespacing issues with operation method names, I've added a `.meta` object similar to what's done for boto3.
I think in the future we'll move stuff that's currently in the `ClientCreator` class (like the service model) over to the ClientMeta class.

Additionally, in order for the client to properly support it's `clone` method, we also need the ability for each client to have its own handlers.
Now whenever a client is created, the current set of event handlers is copied.

This means that if a client then registers event handlers through the `.meta` object, other clients will not be affected.

And finally, in order to actually support per client event handlers, the `hooks` module actually needs the ability to create a copy
of the `_PrefixTrie`, which stores the mapping of event names to event handlers.

cc @danielgtaylor