Pavel, thank you for your response
W dniu niedziela, 29 grudnia 2013 08:50:08 UTC+1 użytkownik Pavel Shaydo napisał: > > > You're expecting plugin to behave as you want and not as it is > documented. Documentation doesn't say that it will be the same > connection every time. If you look into source you will see that it > creates a pool of connections. You are right. I was looking rather for asynchronous behavior, to make execution of my series of related queries non-blocking. Yes I saw the "pool" in the documentation, but thought of it rather in a more traditional way like there was a connection pool manager between a web server and the database itself. That was a "pool on server level". This one is a "pool on application level". > Problem is that to execute several statements you have to lock > connection to exclusively serve a particular request. > Event-driven > application may process multiple requests simultaneously. That gives a power I did not initially think of. I may fire several queries in parallel in cases where execution order is not important. However, some queueing is still necessary to limit number of simultaneous queries running and not kill the database. > > I think you should create a pool of connections and each request should > be able to get connection from the pool and use it exclusively and > return it to the pool when it don't need it anymore. This particular > plugin doesn't provide such functionality. > It seems I could try to modify the PgAsync plugin. At first look, it seems that the current single db pool array could be replaced with a hash of pools whose keys could be values of tx->connection, plus an attribute holding max_db_connections per pool. max_db_connections=1 would meet my original need. A special 'public' key, could hold a pool behaving in the way compatible with current version. Also some use_private_pool attrubute is necessary, and interface to the attributes. I think I need to ask author of the module what he thinks. Alexander, are you here? Pavel, thanks again for your advices. Irek. -- You received this message because you are subscribed to the Google Groups "Mojolicious" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/mojolicious. For more options, visit https://groups.google.com/groups/opt_out.
