send_tasks.py 435 B

1234567891011121314151617181920212223
  1. import click
  2. from sentry.taskdemo import say_hello
  3. def produce_activations(num_activations: int):
  4. for i in range(num_activations):
  5. say_hello.delay(f"{i}")
  6. @click.option(
  7. "--num-activations",
  8. type=int,
  9. default=1,
  10. show_default=True,
  11. help="Number of task activations to send to kafka",
  12. )
  13. def main(num_activations: int):
  14. produce_activations(num_activations)
  15. if __name__ == "__main__":
  16. main()