Code Monkey home page Code Monkey logo

elevate's People

Contributors

mattgreen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

elevate's Issues

Question: do you have some more docs on "service objects" and HTTP class?

You mention in the readme "... when your tasks become complex, you can elect to extract them out to a service object." Do you have an example of what you mean there?

Also, do you have any docs for the "API" class which you say "is a thin wrapper class over Elevate::HTTP"?

I'd really like to use this framework, but I'm struggling to get started without an end-to-end example, or some more docs. Thanks.

Regards,
M@

question

Undefined method error

I'm getting the following error when trying to use elevate:

2013-07-08 12:46:04.108 ExampleApp[29827:1b03] user.rb:12:in `block in authenticate!:': undefined method `post' for Elevate::HTTP:Class (NoMethodError)
    from operation.rb:50:in `main'

And the code:

def authenticate!(username, password)
  @authenticate_task = async username: username, password: password do
    task do
      response = Elevate::HTTP.post("http://example.com/api/sessions.json", username: @username, password: @password)
      puts "response: "
      puts response.inspect
    end
    on_start do
      puts "requesting.."
    end    
    on_finish do |result, exception|
      puts "complete.."
      puts result.inspect
    end
  end
end

What's really strange is rubymotion seems to be renaming classes inside the HTTP namespace... for example this fails:

(main)> Elevate::HTTP::Request::METHODS
2013-07-08 12:56:02.128 ExampleApp[30165:c07] uninitialized constant Elevate::HTTP::Request (NameError)
=> #<NameError: uninitialized constant Elevate::HTTP::Request>

But this works:

(main)> Elevate::HTTP::HTTPRequest::METHODS
=> [:get, :post, :put, :delete, :patch, :head, :options]

Any ideas?

Thanks!! ๐Ÿบ

Periodic task

Hi,

I would like to write a periodic task with BW::EM.add_periodic_timer , and I'm wondering if I can use Elevate::HTTP safely with it. Or maybe there is a way with Elevate to create periodic task.
Could you help me ?

Regards,

Julien

Generalize HTTP component

Right now, only JSON APIs are supported. Generalize that to a Elevate::HTTP module with a straight-forward API, and update HTTPClient to use it.

License missing from gemspec

Some companies will only use gems with a certain license.
The canonical and easy way to check is via the gemspec
via e.g.

spec.license = 'MIT'
# or
spec.licenses = ['MIT', 'GPL-2']

There is even a License Finder to help companies ensure all gems they use
meet their licensing needs. This tool depends on license information being available in the gemspec.
Including a license in your gemspec is a good practice, in any case.

How did I find you?

I'm using a script to collect stats on gems, originally looking for download data, but decided to collect licenses too,
and make issues for missing ones as a public service :)
https://gist.github.com/bf4/5952053#file-license_issue-rb-L13 So far it's going pretty well

Use AFNetworking

Maintaining the HTTP component requires more effort than it's worth. Find a way to connive AFNetworking to play nicely with Elevate.

Timeout support

Users should be able to set timeouts for the resulting operation. An NSTimer would start at the operation time. When it fired, we can cancel() the IOCoordiantor, perhaps passing in an exception to be raised on the waiting thread. This exception can be checked inside of the NSOperation to determine if the cancellation was due to a user or a timeout.

We also want to support an on_timeout block.

Question -- tutorial uses async, my code fails with NoMethodError?

I've just started using Elevate and am very impressed. For simple 'gets' with no parameters, it's just what my team and I need.
But no matter what I try, I can't seem to pass a parameter into the task for 'posts'. The working examples all either use hard-coded values in setting up args or define tasks with async. I can't use the former because the argument is instance-level dynamic, and task creation is class level. I can't use the latter because async fails with NoMethodError. Worse, I can't find 'async' or any reference to it in any of the source code.
Any guidance would be appreciated!

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.