Giter Site home page Giter Site logo

Request: make everything asynchronous about traad HOT 5 CLOSED

tkf avatar tkf commented on August 16, 2024
Request: make everything asynchronous

from traad.

Comments (5)

abingham avatar abingham commented on August 16, 2024

Right, I definitely plan to move to an asynchronous system once I've
got a good grasp on the basics. I don't know when that'll be, but
it'll be a necessity for larger projects.

Austin

On Mon, Jul 23, 2012 at 7:42 PM, Takafumi Arakaki
[email protected]
wrote:

Isn't it better to use xml-rpc-method-call-async instead of xml-rpc-method-call? Asynchronous programming is bit hard but otherwise you can't use the advantage of having multiple processes. I prefer not waiting during traad does the job in background.


Reply to this email directly or view it on GitHub:
#6

from traad.

tkf avatar tkf commented on August 16, 2024

Cool! I can't wait to see that. I'm closing this as it's on your plan.

from traad.

abingham avatar abingham commented on August 16, 2024

I've added some support for async calls. The refactorings should all run asynchronously now, so let me know what you think.

One issue related to this which I haven't resolved yet is how to properly revert buffers associated with refactorings. Prior to this change, the buffer from which a refactoring was run would be automatically reverted when the refactoring finished. I'm not sure what the best way to do that is with the async call handler...any thoughts or advice?

from traad.

tkf avatar tkf commented on August 16, 2024

Awesome! I haven't tried yet, but by quick glance, I think changing traad-call-async to something like

(defun traad-call-async (callback func &rest args)
  (apply
   #'xml-rpc-method-call-async
   (lexical-let ((callback callback))
     (lambda (result) (traad-async-handler result callback)))
   (concat
    "http://" traad-host ":"
    (number-to-string traad-port))
   func args))

should solve the problem. You can revert buffer in the callback. Probably you would want to add another argument for callback so that you can call it like this (traad-call-async func funargs callback cbargs), otherwise, user of traad-call-async must use lexical-let again.

from traad.

abingham avatar abingham commented on August 16, 2024

Great, thanks. I've implemented part of what you suggested, and I'll look at the rest (the cbargs bit) when I get a chance.

from traad.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.