handler 0.0.1 copy "handler: ^0.0.1" to clipboard
handler: ^0.0.1 copied to clipboard

Handling multiple function calls at time

Handler: Can able to handle multiple async calls once at a time

Features #

Reduce memory while multiple api calls

Getting started #

import 'package:handler/handler.dart';

Usage #

import 'dart:math';
import 'package:handler/handler.dart';
void main() async {
  final handler = Handler();

  // Use the rate limiter with any function
  for (var i = 0; i < 5; i++) {
    final result = await handler.execute((() async {
      // Simulate a time-consuming operation
      await Future.delayed(Duration(seconds: 2));
      return Random().nextInt(9999);
    }));
    print(result);
  }
}
8
likes
130
points
36
downloads

Publisher

verified publisherstarproxima.dev

Weekly Downloads

Handling multiple function calls at time

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on handler