{"action":"created","issue":{"url":"https://api.github.com/repos/harlowja/fasteners/issues/15","labels_url":"https://api.github.com/repos/harlowja/fasteners/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/harlowja/fasteners/issues/15/comments","events_url":"https://api.github.com/repos/harlowja/fasteners/issues/15/events","html_url":"https://github.com/harlowja/fasteners/issues/15","id":120024767,"number":15,"title":"How to handle multiple running instances?","user":{"login":"paulochf","id":107470,"avatar_url":"https://avatars.githubusercontent.com/u/107470?v=3","gravatar_id":"","url":"https://api.github.com/users/paulochf","html_url":"https://github.com/paulochf","followers_url":"https://api.github.com/users/paulochf/followers","following_url":"https://api.github.com/users/paulochf/following{/other_user}","gists_url":"https://api.github.com/users/paulochf/gists{/gist_id}","starred_url":"https://api.github.com/users/paulochf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulochf/subscriptions","organizations_url":"https://api.github.com/users/paulochf/orgs","repos_url":"https://api.github.com/users/paulochf/repos","events_url":"https://api.github.com/users/paulochf/events{/privacy}","received_events_url":"https://api.github.com/users/paulochf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-12-02T20:06:24Z","updated_at":"2015-12-02T23:16:02Z","closed_at":null,"body":"Hi!\r\n\r\nI'm converting my code from lockfile to fasteners and then I got stuck on a problem.\r\n\r\nI have a script started by cron about a couple minutes which I want it to be the only instance running.\r\nI think it's normal some executions last for more than 2 minutes, but I want that new instances started by cron while another is running don't wait for the lock.\r\n\r\nNow, the script (a Django Command) is something like below:\r\n\r\n```python\r\nclass Command(BaseCommand):\r\n    # ...\r\n\r\n    @interprocess_locked(\"path/to/lock\")\r\n    def handle(self, *args, **options):\r\n        # do something\r\n```\r\n\r\nbut if I run it twice, one runs and the other waits.\r\n\r\nWhat should I do to get the behavior I want? I guess it could be related to the [context manager quoted in Readme](https://github.com/harlowja/fasteners#generic-helpers). It's a guess, but maybe if I use it at `handle()` beggining instead of the decorator I could get that, but I'm finding difficult to use due the lack of documentation for the waiting rule. Something like:\r\n\r\n```python\r\nclass Command(BaseCommand):\r\n    # ...\r\n\r\n    def handle(self, *args, **options):\r\n        ### pseudocode\r\n        with \"try to get lock at 'path/to/lock' without waiting it\":\r\n            # do something\r\n```\r\n\r\nThank you so much!"},"comment":{"url":"https://api.github.com/repos/harlowja/fasteners/issues/comments/161464044","html_url":"https://github.com/harlowja/fasteners/issues/15#issuecomment-161464044","issue_url":"https://api.github.com/repos/harlowja/fasteners/issues/15","id":161464044,"user":{"login":"harlowja","id":970458,"avatar_url":"https://avatars.githubusercontent.com/u/970458?v=3","gravatar_id":"","url":"https://api.github.com/users/harlowja","html_url":"https://github.com/harlowja","followers_url":"https://api.github.com/users/harlowja/followers","following_url":"https://api.github.com/users/harlowja/following{/other_user}","gists_url":"https://api.github.com/users/harlowja/gists{/gist_id}","starred_url":"https://api.github.com/users/harlowja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harlowja/subscriptions","organizations_url":"https://api.github.com/users/harlowja/orgs","repos_url":"https://api.github.com/users/harlowja/repos","events_url":"https://api.github.com/users/harlowja/events{/privacy}","received_events_url":"https://api.github.com/users/harlowja/received_events","type":"User","site_admin":false},"created_at":"2015-12-02T23:16:02Z","updated_at":"2015-12-02T23:16:02Z","body":"I'm unsure how it would get added to the decorator, what does it do if it is unable to get the lock, does it not call the underlying function or throw an error or something?"}}