# |
Mar 2nd 2018, 16:56 |
savant |
you can assume that you can split that string by Model\Entity |
# |
Mar 2nd 2018, 16:56 |
rudy1976s |
I am at that point |
# |
Mar 2nd 2018, 16:56 |
savant |
since its an entity |
# |
Mar 2nd 2018, 16:56 |
rudy1976s |
exact |
# |
Mar 2nd 2018, 16:56 |
savant |
and that will return the full-namespaced class nam |
# |
Mar 2nd 2018, 16:55 |
savant |
get_class($entity) |
# |
Mar 2nd 2018, 16:55 |
savant |
err |
# |
Mar 2nd 2018, 16:55 |
savant |
https://gist.github.com/jasondmoss/6200807 |
# |
Mar 2nd 2018, 16:55 |
rudy1976s |
I try to explain better |
# |
Mar 2nd 2018, 16:55 |
savant |
but you can do |
# |
Mar 2nd 2018, 16:54 |
savant |
I dont think entities have their plugin anywhere |
# |
Mar 2nd 2018, 16:52 |
rudy1976s |
I have a question: I have a entity object and I need to extract plugin and class name: how can I do that? |
# |
Mar 2nd 2018, 16:51 |
rudy1976s |
Good evening |
# |
Mar 2nd 2018, 15:02 |
inoas |
in case url, query params and (non-ignored) headers are the same |
# |
Mar 2nd 2018, 15:02 |
inoas |
and if cache is enabled through Configure it gets that from a cachedClient cache config (at the moment Apcu) |
# |
Mar 2nd 2018, 15:01 |
inoas |
at the moment I just added a getCachedBody() method to CachedClient() |
# |
Mar 2nd 2018, 15:01 |
inoas |
anyway I will let you know if things work out |
# |
Mar 2nd 2018, 15:01 |
inoas |
so every time you would get back a different respose (in this case a different token, best case from the cache, non-blocking filling up the buffer/pool behind) |
# |
Mar 2nd 2018, 15:00 |
inoas |
consume because obviously POST would not be idempotent |
# |
Mar 2nd 2018, 15:00 |
inoas |
and if the token server doesn't respond you still have a pool to "consume" |
# |
Mar 2nd 2018, 14:59 |
inoas |
you would get 100 tokens ahead of time and once you are down to say 10, you fetch another 100, or you refill immediatly |
# |
Mar 2nd 2018, 14:59 |
inoas |
well if you get some tokens from a server |
# |
Mar 2nd 2018, 14:58 |
admad |
caching POST/PUT ?? |
# |
Mar 2nd 2018, 14:58 |
inoas |
:( |
# |
Mar 2nd 2018, 14:58 |
inoas |
and I don't want things to error out |
# |
Mar 2nd 2018, 14:58 |
inoas |
all those is because some web services are flanky and don't have 100% uptime but are required for front end / end user processes |
# |
Mar 2nd 2018, 14:57 |
admad |
"Custom caching decision" is probably what you would need |
# |
Mar 2nd 2018, 14:57 |
inoas |
though I need it for POST/PUT too... as weird as it sounds - in that case the cached responses would get "consumed" |
# |
Mar 2nd 2018, 14:57 |
inoas |
nice |
# |
Mar 2nd 2018, 14:56 |
admad |
this would be one of the cases where using the beast guzzle would be justified http://guzzle3.readthedocs.io/plugins/cache-plugin.html |
# |
Mar 2nd 2018, 14:50 |
hmic |
lets go for it! i do like your proposal in some weird ways, to allow caching on that level |
# |
Mar 2nd 2018, 14:48 |
hmic |
does not look too bad to me... but once there are more than one adapter, defining an interface does make sense nether the less... |
# |
Mar 2nd 2018, 14:47 |
hmic |
thats a hell of an interface to go wrong :P |
# |
Mar 2nd 2018, 14:47 |
inoas |
you got a point there |
# |
Mar 2nd 2018, 14:46 |
hmic |
inoas, you are really concerned about the 3 methods the adapter exposes? :O |
# |
Mar 2nd 2018, 14:45 |
inoas |
(same interface for Cake\Http\Client\Adapter\Stream and for my new adapter obviously) |
# |
Mar 2nd 2018, 14:44 |
inoas |
... and once the interface is build and the adapter runs I should PR that interface to the core? |
# |
Mar 2nd 2018, 14:44 |
inoas |
hmic the problem is that I also want to prefetch things and store them, just using an outside http proxy is not easier |
# |
Mar 2nd 2018, 14:43 |
inoas |
so I should build my own interface based on the implicit one |
# |
Mar 2nd 2018, 14:43 |
hmic |
i still guess it's not worth it... |
# |
Mar 2nd 2018, 14:43 |
inoas |
ok |