| *** roq_ has joined #zope | 00:28 | |
| *** Jan_Garaj3 has quit IRC | 00:40 | |
| *** Jan_Garaj3 has joined #zope | 00:46 | |
| *** m8 has quit IRC | 01:16 | |
| *** menesis has quit IRC | 01:34 | |
| *** J1m_ has quit IRC | 02:00 | |
| *** Jan_Garaj3 has quit IRC | 04:35 | |
| *** bosim has joined #zope | 08:24 | |
| *** bosim has joined #zope | 08:28 | |
| *** __mac__ has joined #zope | 08:35 | |
| mgedmin | welp | 08:47 |
|---|---|---|
| mgedmin | anyone alive? | 08:48 |
| mgedmin | can anybody test the new zope.testrunner release I just made? | 08:48 |
| mgedmin | ok I think I stumbled upon some weird setuptools bug wrt namespace packages | 09:01 |
| mgedmin | and now I cannot reproduce it | 09:09 |
| *** tisto has joined #zope | 09:15 | |
| *** agroszer has joined #zope | 09:24 | |
| *** MrTango has joined #zope | 09:29 | |
| *** MrTango has quit IRC | 09:34 | |
| *** menesis has joined #zope | 09:52 | |
| *** giacomos has joined #zope | 10:19 | |
| *** Jan_Garaj3 has joined #zope | 10:36 | |
| *** MrTango has joined #zope | 10:49 | |
| *** giacomos has quit IRC | 11:18 | |
| *** giacomos has joined #zope | 11:18 | |
| *** Jan_Garaj3 has quit IRC | 12:03 | |
| *** projekt01 has joined #zope | 12:05 | |
| *** fredvd has joined #zope | 12:17 | |
| *** maurits has joined #zope | 13:00 | |
| *** fRiSi has joined #zope | 13:04 | |
| *** MrTango has quit IRC | 13:10 | |
| *** projekt01 has quit IRC | 13:26 | |
| *** projekt01 has joined #zope | 13:27 | |
| *** MrTango has joined #zope | 13:28 | |
| *** bosim has quit IRC | 13:30 | |
| *** bosim has joined #zope | 13:31 | |
| *** tisto has quit IRC | 13:38 | |
| *** MrTango has quit IRC | 13:40 | |
| *** MrTango has joined #zope | 13:44 | |
| *** menesis has quit IRC | 14:14 | |
| *** projekt01 has quit IRC | 14:45 | |
| *** J1m has joined #zope | 14:47 | |
| *** bosim has quit IRC | 14:51 | |
| *** bosim has joined #zope | 14:54 | |
| *** projekt01 has joined #zope | 14:55 | |
| *** J1m has quit IRC | 14:56 | |
| *** menesis has joined #zope | 15:12 | |
| *** J1m_ has joined #zope | 15:27 | |
| *** tisto has joined #zope | 15:55 | |
| *** tiwula has joined #zope | 16:18 | |
| *** agroszer has quit IRC | 16:35 | |
| *** yvl has quit IRC | 17:35 | |
| *** bosim has quit IRC | 17:41 | |
| *** tisto has quit IRC | 17:58 | |
| *** tisto has joined #zope | 18:00 | |
| *** Jan_Garaj3 has joined #zope | 18:24 | |
| *** malinoff has joined #zope | 18:34 | |
| malinoff | Hi! Can someone explain what's the type of `context` object that getSiteManager accepts? | 18:36 |
| malinoff | Talking about this line: https://github.com/zopefoundation/zope.component/blob/master/src/zope/component/_api.py#L45 | 18:36 |
| malinoff | anyone alive here?:) | 18:42 |
| *** fredvd has quit IRC | 18:48 | |
| projekt01 | malinoff, the documentation says | 18:49 |
| projekt01 | Get the nearest site manager in the given context. | 18:49 |
| projekt01 | If context is None, return the global site manager. | 18:49 |
| projekt01 | If the context is not None, it is expected that an adapter | 18:49 |
| projekt01 | from the context to IComponentLookup can be found. If no | 18:49 |
| projekt01 | adapter is found, a ComponentLookupError is raised. | 18:49 |
| projekt01 | see: zope.component.interfaces.IComponentArchitecture <getSiteManager> | 18:49 |
| malinoff | projekt01, i don't really understand that "context" definition. What is context? What it should provide in order to be used to find the nearest site manager? | 18:52 |
| malinoff | However, i guess i just found what i need here http://docs.zope.org/zope.component/api/adapter.html | 18:52 |
| projekt01 | this means that an object could return it0's parent by access context.__parent__ | 18:52 |
| malinoff | Really? The previous link i pasted says that __conform__ method is used | 18:53 |
| projekt01 | malinoff, what do you need to do? | 18:53 |
| malinoff | projekt01, I just trying to figure out the best way to not use the global registry, i'd rather pass a custom instance everywhere explicitly | 18:54 |
| projekt01 | hwy? | 18:54 |
| projekt01 | why? | 18:54 |
| malinoff | because i don't like globals, because it won't work with multiprocessing, because i should think about thread safety when using gevent and friends, etc, etc | 18:55 |
| projekt01 | why should a global not work with gevent? | 18:56 |
| *** tisto has quit IRC | 18:56 | |
| malinoff | i don't think it won't work with gevent, i'm saying that i *should think* about it | 18:56 |
| projekt01 | the global registry is not writable | 18:57 |
| projekt01 | are you using the ZODB or not? | 18:57 |
| malinoff | it's really not a question "should i use the global registry or not", the answer is definitely "no" | 18:57 |
| malinoff | nope | 18:58 |
| malinoff | I just found that zca is suitable for my needs at first glance | 18:58 |
| malinoff | I'm not very familiar with zope infrastructure | 18:59 |
| malinoff | (yet, i think) | 18:59 |
| projekt01 | the global registry is just a dispatcher for lookup the right thing, it works with gevent with threads or no threads | 18:59 |
| malinoff | will it work with multiprocessing stuff correctly? and with fork + exec? | 19:00 |
| projekt01 | how do you call mutliprocessing? | 19:01 |
| projekt01 | with subprocess? | 19:01 |
| malinoff | i mean `import multiprocessing` thing | 19:01 |
| malinoff | billiard, actually | 19:01 |
| malinoff | but it doesn't matter | 19:01 |
| projekt01 | normaly the only problem is the python environment which you can loose in a subprocess | 19:02 |
| projekt01 | I use gevent, celery, rabittmq and the global registry all in one | 19:02 |
| projekt01 | it's just a question of the enironment setup | 19:02 |
| projekt01 | if you setup the subprocess with the right global registry and what you need, then it's just there | 19:03 |
| malinoff | imagine that the parent process registered a named utility in the global registry; then i set up a multiprocessing.Pool instance which uses fork+exec, will i be able to get the registered utility in a pool worker? | 19:04 |
| projekt01 | take a look at the z3c.rml package, there we use the subprocess module and support the environment too given from the main process | 19:05 |
| projekt01 | it depends on when you setup the utility | 19:05 |
| malinoff | as i said, before instantiating Pool instance | 19:06 |
| projekt01 | normaly you will setup the global registry with all utilities and then use it | 19:06 |
| projekt01 | if this global registr is avaliable in the subprocess, then the utilities are just there | 19:06 |
| projekt01 | same as a global variable defined in a module | 19:06 |
| projekt01 | ok, yes, then it is available | 19:07 |
| malinoff | right, but when using fork+exec the memory of the main process is not copied to the workers, so they'll have *different* instance of the global registry | 19:07 |
| projekt01 | if you define a module with a global registry and some utilities and a global variable in the same module, both are available at any time | 19:08 |
| projekt01 | yes, different instances | 19:08 |
| projekt01 | as everything else | 19:08 |
| malinoff | that's why i need to pass the registry explicitly to the worker pool - so if i need to do that, why should i use the global at all? It's much simpler to have a custom instance passed everywhere explicitly than defining edge cases when a user should use the global one and when he shouldn't | 19:10 |
| malinoff | more than that, I want to have a command line option to switch between registries | 19:11 |
| malinoff | similar to celery -A otherapp | 19:11 |
| projekt01 | I guess I have to less info to help you, but as allways it's a question about memory, cpu and how to scale | 19:12 |
| projekt01 | I don't say that using a global registry is the right concept, but it will work if you do so | 19:13 |
| malinoff | i agree, i just have a bad times using globals and i want to avoid it as much as possible | 19:15 |
| malinoff | even if they works *now*, some new concurrency library will break it | 19:16 |
| malinoff | s/works/work | 19:16 |
| malinoff | anyway, thanks for your input | 19:17 |
| projekt01 | no problem, see you later... | 19:17 |
| malinoff | i'll take a look on z3c.rml | 19:17 |
| projekt01 | it's just a hack to support the minimal environment for generate the pdf in a subprocess | 19:18 |
| *** projekt01 has quit IRC | 19:19 | |
| malinoff | you mean this line https://github.com/zopefoundation/z3c.rml/blob/master/src/z3c/rml/rml2pdfscript.py#L80 ? | 19:19 |
| *** Jan_Garaj3 has quit IRC | 19:43 | |
| malinoff | projekt01, just found this pyramid doc describing almost all my concerns about thread locals: http://docs.pylonsproject.org/projects/pyramid/en/latest/narr/threadlocals.html#threadlocals-chapter | 19:43 |
| *** maurits has quit IRC | 19:49 | |
| *** giacomos has quit IRC | 19:51 | |
| *** Jan_Garaj3 has joined #zope | 19:56 | |
| *** J1m has joined #zope | 20:16 | |
| *** J1m_ has quit IRC | 20:16 | |
| *** J1m_ has joined #zope | 20:30 | |
| *** MrTango has quit IRC | 20:30 | |
| *** J1m_ has quit IRC | 20:35 | |
| *** supton has joined #zope | 20:55 | |
| *** menesis has quit IRC | 21:16 | |
| *** fdrake has quit IRC | 21:29 | |
| *** malinoff has quit IRC | 21:31 | |
| *** Jan_Garaj3 has quit IRC | 21:35 | |
| *** Jan_Garaj3 has joined #zope | 22:02 | |
| *** menesis has joined #zope | 22:17 | |
| *** fredvd has joined #zope | 22:43 | |
| *** __mac__ has quit IRC | 23:04 | |
| *** alecm has joined #zope | 23:08 | |
| *** alecm has joined #zope | 23:08 | |
Generated by irclog2html.py 4.0.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!