fediverse_pasture.runner
ActivityRunner
dataclass
Coordinates sending an activity to many applications through an ActivitySender instances
Parameters:
Name | Type | Description | Default |
---|---|---|---|
activity_sender |
ActivitySender
|
an activity sender |
required |
applications |
List[ApplicationAdapterForLastActivity]
|
list of applications to run against |
required |
Source code in fediverse_pasture/runner/__init__.py
run_for_modifier(modifier, wait_time=2.0)
async
modifier has the same format as for ActivitySender
Source code in fediverse_pasture/runner/__init__.py
ActivitySender
dataclass
The ActivitySender class serves as a way to coordinate the process of sending the same activity to multiple Fediverse applications.
The basic process is
- Create an Activity with a published timestamp stored in published
- Send this activity to applications using
send
- Retrieve the result from said applications
The usual way to create an ActivitySender is the for_actor
method,
i.e.
Source code in fediverse_pasture/runner/__init__.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
|
for_actor(bovine_actor, actor_object)
staticmethod
Initializes the Activity Sender object for a given BovineActor and the corresponding actor object
Source code in fediverse_pasture/runner/__init__.py
init_create_note(modifier)
Sets activity to a Create for a Note. Here the Note is
constructed from a skeleton by applying modifier
to it.
To successfully send the note to most applications, modifier
should set the Note’s content, i.e.
This method can be used to create objects of other types by overriding “type”.
Source code in fediverse_pasture/runner/__init__.py
send(remote)
async
Sends the activity to the remote user
Parameters:
Name | Type | Description | Default |
---|---|---|---|
remote |
str
|
Actor URI of the remote user |
required |