Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add async macros to common Facade methods #89

Merged
merged 2 commits into from
Jun 11, 2024
Merged

Conversation

Log1x
Copy link
Member

@Log1x Log1x commented Jun 10, 2024

This adds async macros to common methods inside of the Cache, Http, Storage, and File facades.

Cache::getAsync(string $key);
Cache::putAsync(string $key, mixed $value, int $seconds);
Cache::rememberAsync(string $key, int $seconds, callable $callback);
Cache::rememberForeverAsync(string $key, callable $callback);

Http::getAsync(string $url, array|string|null $query = []);
Http::postAsync(string $url, array $data = []);

File::getAsync(string $path);
File::putAsync(string $path, mixed $contents);

Storage::getAsync(string $path);
Storage::putAsync(string $path, mixed $contents);

Change log

Enhancements

  • ✨ Add async macros for common methods to the Cache, Http and Storage facades
  • ✨ Create an CanAsync trait to easily perform async tasks in the event loop

Log1x added 2 commits June 9, 2024 22:46
…rage` facades

✨ Create an `CanAsync` trait to easily perform async tasks in the event loop
@Log1x Log1x merged commit 9feeba3 into main Jun 11, 2024
1 check passed
@Log1x Log1x deleted the feat/async-facade-macros branch June 11, 2024 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant