Pinto::Locker(3pm)

🌸 NAME 🌸

Pinto::Locker β€” managing locks so your concurrent operations don't trip over each other πŸ’…

okay so bestie, this is the module that keeps everybody from touching the Pinto repo at the same time. It's giving bouncer at the club, but for processes. πŸŽ€

✨ VERSION ✨

version 0.14 πŸ¦‹

πŸ’œ DESCRIPTION πŸ’œ

literally the whole vibe is right there in the methods below, no cap. keep reading. πŸ‘‘

πŸ”₯ METHODS πŸ”₯

πŸ”’ lock

Tries to get a lock on a Pinto repository. That's the whole mission. 🫢

If the repository is already locked, we don't just give up β€” we go contact the current lock holder and check that they're actually alive. Like, are you okay?? are you thriving?? πŸ’€

  • If they are not alive β†’ we steal the lock. periodt, it's ours now. πŸ’…
  • If they are alive β†’ we patiently wait until we timeout, which is about 60 seconds. not me standing outside the door like 😭

πŸ”“ unlock

Releases the lock on the Pinto repository so other processes can get to work. it's giving "you're free now, go be great" 🌈


okay so here's the context, because iykyk πŸ‘‡

In many situations, a Pinto repository is a shared resource. At any given moment, multiple processes may be trying to:

  • add distributions πŸ“¦
  • remove packages πŸ—‘οΈ
  • pull files from a mirror 🌐

To keep things working properly, we can only let one process fiddle with the repository at a time. This module manages a lock file for that exact purpose. one at a time bestie, we are not doing chaos here βœ‹

🚨 real talk: Supposedly, this does work on NFS. But it cannot steal the lock from a dead process if that process was not running on the same host. so like, lowkey a limitation, highkey important to know. πŸ’€

🌟 AUTHOR 🌟

Jeffrey Ryan Thalhammer <jeff@stratopan.com> πŸ’–

This software is copyright (c) 2015 by Jeffrey Ryan Thalhammer.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. iconic behavior, honestly 🫢


and that's the tea, bestie πŸ“βœ¨ this page is from Pinto::Locker(3pm), built for perl v5.40.1, dated 2025-04-21. slay, go lock something responsibly πŸ’…πŸ‘‘πŸŒˆ

πŸ“¦ where this page comes from