On Mon, Nov 22, 2021 at 8:57 AM Billy Zheng <vil...@gmail.com> wrote:

> > In order not to block the interpreter, Sequel uses #async_exec and not
> #exec on the PG::Connection.  Perhaps that's the cause of the problem?  Do
> you get the same results as Sequel if you use #async_exec on the
> PG::Connection (with #block afterward)?
>
>
> After change from
>
> db = PG.connect(URI(DB_URL))
>
> db.exec("UPDATE investing_latest_news SET title = title;")
>
> To
>
> db.async_exec("UPDATE investing_latest_news SET title = title;")
>
> It still work.
>
> ----------------------------
>
> I don't sure about what is you means of "with #block afterward" , maybe
> you want
>

"With #block after" means:

db.async_exec("UPDATE investing_latest_news SET title = title;")
db.block

#block just waits for the async execution to finish.


> DB.synchronize do |conn|
>   conn.async_exec("UPDATE investing_latest_news SET title = title;")
> end
>
> or
>
> DB.synchronize do |conn|
>   conn.exec("UPDATE investing_latest_news SET title = title;")
> end
>
> Above two cases both NOT work.
>

If the above doesn't work, unfortunately, I'm out of ideas.  If you can put
together a self-contained example that only depends on Sequel and nothing
else, I can do more research. However, if you cannot, I will not be able to
help further.  Sorry.

Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sequel-talk+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/CADGZSSfMg4j676bEzB8fUNbtH2PdDqX7%2Be_AuH8UmdJag0cqGQ%40mail.gmail.com.

Reply via email to