Closed inactivist closed 12 years ago
Hi, thanks for taking a look at my new project. If you're using django, it maintains the provider registry globally at module scope, so it is only loaded once when your application starts up. There will be a slight delay. If you are using django you can import the bootstrapped providers like this:
from micawber.contrib.mcdjango import providers
micawber.parse_text(..., providers)
You can of course write your own bootstrap_ function that does something similar to bootstrap_embedly and loads the rules from a file or the database. All you need to track is the provider's regex and the endpoint it is mapped to, which in embedly's case is always the same.
I've updated the docs to make this a bit more clear on this.
See https://github.com/coleifer/micawber/blob/master/micawber/contrib/mcdjango/__init__.py#L17
Awesome, thanks for that info, it's exactly what I needed to know. Edit: I started code diving and saw that there was no caching... so I guess I was expecting most of your answer :D
Hi, I'm new to micawber, and I'm reading the docs. I have a question about bootstrap_embedly.
If I want to use embed.ly, is bootstrap_embedly required initialization every time? For example, if I call it in a django web app's initialization code, is it going to cause a delay at startup? Or does it cache results for future use?
From the docs:
A bit more detail in the docs regarding this issue would be appreciated.